mirror of
https://github.com/matrix-construct/construct
synced 2025-03-31 23:11:33 +02:00
ircd::ctx: Add minor commentary.
This commit is contained in:
parent
7197491364
commit
a880e2e43e
3 changed files with 10 additions and 0 deletions
|
@ -30,6 +30,10 @@ enum class cv_status
|
|||
no_timeout, timeout
|
||||
};
|
||||
|
||||
/**
|
||||
* a dock is a condition variable which has no requirement for locking
|
||||
* because the context system does not require mutual exclusion.
|
||||
*/
|
||||
class dock
|
||||
{
|
||||
std::deque<ctx *> q;
|
||||
|
|
|
@ -25,6 +25,11 @@
|
|||
namespace ircd {
|
||||
namespace ctx {
|
||||
|
||||
/**
|
||||
* The mutex only allows one context to lock it and continue,
|
||||
* additional contexts are queued. This can be used with std::
|
||||
* locking concepts.
|
||||
*/
|
||||
class mutex
|
||||
{
|
||||
bool m;
|
||||
|
|
|
@ -802,6 +802,7 @@ ircd::ctx::ole::offload(const std::function<void ()> &func)
|
|||
eptr = std::current_exception();
|
||||
}
|
||||
|
||||
// To wake the context on the IRCd thread we give it the kick
|
||||
strand(*context, kick);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue