[ { "psig_desc": [ "Psig_attribute", { "attr_name": { "loc2": { "loc_start": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_end": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_ghost": true }, "txt2": "ocaml.text" }, "attr_payload": [ "PStr", [ { "pstr_desc": [ "Pstr_eval", { "pexp_desc": [ "Pexp_constant", [ "Pconst_string", "Condition variables.\n\n Condition variables are useful when several threads wish to access a\n shared data structure that is protected by a mutex (a mutual exclusion\n lock).\n\n A condition variable is a {i communication channel}. On the receiver\n side, one or more threads can indicate that they wish to {i wait}\n for a certain property to become true. On the sender side, a thread\n can {i signal} that this property has become true, causing one (or\n more) waiting threads to be woken up.\n\n For instance, in the implementation of a queue data structure, if a\n thread that wishes to extract an element finds that the queue is\n currently empty, then this thread waits for the queue to become\n nonempty. A thread that inserts an element into the queue signals\n that the queue has become nonempty. A condition variable is used for this\n purpose. This communication channel conveys the information that\n the property \"the queue is nonempty\" is true, or more accurately,\n may be true. (We explain below why the receiver of a signal cannot\n be certain that the property holds.)\n\n To continue the example of the queue, assuming that the queue has a fixed\n maximum capacity, then a thread that wishes to insert an element\n may find that the queue is full. Then, this thread must wait for\n the queue to become not full, and a thread that extracts an element\n of the queue signals that the queue has become not full. Another\n condition variable is used for this purpose.\n\n In short, a condition variable [c] is used to convey the information\n that a certain property {i P} about a shared data structure {i D},\n protected by a mutex [m], may be true.\n\n Condition variables provide an efficient alternative to busy-waiting.\n When one wishes to wait for the property {i P} to be true,\n instead of writing a busy-waiting loop:\n {[\n Mutex.lock m;\n while not P do\n Mutex.unlock m; Mutex.lock m\n done;\n ;\n Mutex.unlock m\n ]}\n one uses {!wait} in the body of the loop, as follows:\n {[\n Mutex.lock m;\n while not P do\n Condition.wait c m\n done;\n ;\n Mutex.unlock m\n ]}\n The busy-waiting loop is inefficient because the waiting thread\n consumes processing time and creates contention of the mutex [m].\n Calling {!wait} allows the waiting thread to be suspended, so it\n does not consume any computing resources while waiting.\n\n With a condition variable [c], exactly one mutex [m] is associated.\n This association is implicit: the mutex [m] is not explicitly passed\n as an argument to {!create}. It is up to the programmer to know, for\n each condition variable [c], which is the associated mutex [m].\n\n With a mutex [m], several condition variables can be associated.\n In the example of the bounded queue, one condition variable is\n used to indicate that the queue is nonempty, and another condition\n variable is used to indicate that the queue is not full.\n\n With a condition variable [c], exactly one logical property {i P}\n should be associated. Examples of such properties\n include \"the queue is nonempty\" and \"the queue is not full\".\n It is up to the programmer to keep track, for each condition\n variable, of the corresponding property {i P}.\n A signal is sent on the condition variable [c]\n as an indication that the property {i P} is true, or may be true.\n On the receiving end, however, a thread that is woken up\n cannot assume that {i P} is true;\n after a call to {!wait} terminates,\n one must explicitly test whether {i P} is true.\n There are several reasons why this is so.\n One reason is that,\n between the moment when the signal is sent\n and the moment when a waiting thread receives the signal\n and is scheduled,\n the property {i P} may be falsified by some other thread\n that is able to acquire the mutex [m] and alter the data structure {i D}.\n Another reason is that {i spurious wakeups} may occur:\n a waiting thread can be woken up even if no signal was sent.\n\n Here is a complete example, where a mutex protects a sequential\n unbounded queue, and where a condition variable is used to signal\n that the queue is nonempty.\n {[\n type 'a safe_queue =\n { queue : 'a Queue.t; mutex : Mutex.t; nonempty : Condition.t }\n\n let create () =\n { queue = Queue.create(); mutex = Mutex.create();\n nonempty = Condition.create() }\n\n let add v q =\n Mutex.lock q.mutex;\n let was_empty = Queue.is_empty q.queue in\n Queue.add v q.queue;\n if was_empty then Condition.broadcast q.nonempty;\n Mutex.unlock q.mutex\n\n let take q =\n Mutex.lock q.mutex;\n while Queue.is_empty q.queue do Condition.wait q.nonempty q.mutex done;\n let v = Queue.take q.queue in (* cannot fail since queue is nonempty *)\n Mutex.unlock q.mutex;\n v\n ]}\n Because the call to {!broadcast} takes place inside the critical\n section, the following property holds whenever the mutex is unlocked:\n {i if the queue is nonempty, then no thread is waiting},\n or, in other words,\n {i if some thread is waiting, then the queue must be empty}.\n This is a desirable property: if a thread\n that attempts to execute a [take] operation\n could remain suspended\n even though the queue is nonempty,\n that would be a problematic situation,\n known as a {i deadlock}. ", { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 16, "pos_bol": 1079, "pos_cnum": 1079 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 140, "pos_bol": 6506, "pos_cnum": 6536 }, "loc_ghost": false }, null ] ], "pexp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 16, "pos_bol": 1079, "pos_cnum": 1079 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 140, "pos_bol": 6506, "pos_cnum": 6536 }, "loc_ghost": false }, "pexp_loc_stack": [], "pexp_attributes": [] }, [] ], "pstr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 16, "pos_bol": 1079, "pos_cnum": 1079 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 140, "pos_bol": 6506, "pos_cnum": 6536 }, "loc_ghost": false } } ] ], "attr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 16, "pos_bol": 1079, "pos_cnum": 1079 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 140, "pos_bol": 6506, "pos_cnum": 6536 }, "loc_ghost": false } } ], "psig_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 16, "pos_bol": 1079, "pos_cnum": 1079 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 140, "pos_bol": 6506, "pos_cnum": 6536 }, "loc_ghost": false } }, { "psig_desc": [ "Psig_type", [ "Recursive" ], [ { "ptype_name": { "loc2": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 142, "pos_bol": 6538, "pos_cnum": 6543 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 142, "pos_bol": 6538, "pos_cnum": 6544 }, "loc_ghost": false }, "txt2": "t" }, "ptype_params": [], "ptype_cstrs": [], "ptype_kind": [ "Ptype_abstract" ], "ptype_private": [ "Public" ], "ptype_manifest": null, "ptype_attributes": [ { "attr_name": { "loc2": { "loc_start": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_end": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_ghost": true }, "txt2": "ocaml.doc" }, "attr_payload": [ "PStr", [ { "pstr_desc": [ "Pstr_eval", { "pexp_desc": [ "Pexp_constant", [ "Pconst_string", " The type of condition variables. ", { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6545 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6584 }, "loc_ghost": false }, null ] ], "pexp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6545 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6584 }, "loc_ghost": false }, "pexp_loc_stack": [], "pexp_attributes": [] }, [] ], "pstr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6545 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6584 }, "loc_ghost": false } } ] ], "attr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6545 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 143, "pos_bol": 6545, "pos_cnum": 6584 }, "loc_ghost": false } } ], "ptype_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 142, "pos_bol": 6538, "pos_cnum": 6538 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 142, "pos_bol": 6538, "pos_cnum": 6544 }, "loc_ghost": false } } ] ], "psig_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 142, "pos_bol": 6538, "pos_cnum": 6538 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 142, "pos_bol": 6538, "pos_cnum": 6544 }, "loc_ghost": false } }, { "psig_desc": [ "Psig_value", { "pval_name": { "loc2": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6590 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6596 }, "loc_ghost": false }, "txt2": "create" }, "pval_type": { "ptyp_desc": [ "Ptyp_arrow", [ "Nolabel" ], { "ptyp_desc": [ "Ptyp_constr", "unit", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6599 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6603 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, { "ptyp_desc": [ "Ptyp_constr", "t", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6607 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6608 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] } ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6599 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6608 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, "pval_prim": [], "pval_attributes": [ { "attr_name": { "loc2": { "loc_start": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_end": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_ghost": true }, "txt2": "ocaml.doc" }, "attr_payload": [ "PStr", [ { "pstr_desc": [ "Pstr_eval", { "pexp_desc": [ "Pexp_constant", [ "Pconst_string", "[create()] creates and returns a new condition variable.\n This condition variable should be associated (in the programmer's mind)\n with a certain mutex [m] and with a certain property {i P} of the data\n structure that is protected by the mutex [m]. ", { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 146, "pos_bol": 6609, "pos_cnum": 6609 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 149, "pos_bol": 6818, "pos_cnum": 6869 }, "loc_ghost": false }, null ] ], "pexp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 146, "pos_bol": 6609, "pos_cnum": 6609 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 149, "pos_bol": 6818, "pos_cnum": 6869 }, "loc_ghost": false }, "pexp_loc_stack": [], "pexp_attributes": [] }, [] ], "pstr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 146, "pos_bol": 6609, "pos_cnum": 6609 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 149, "pos_bol": 6818, "pos_cnum": 6869 }, "loc_ghost": false } } ] ], "attr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 146, "pos_bol": 6609, "pos_cnum": 6609 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 149, "pos_bol": 6818, "pos_cnum": 6869 }, "loc_ghost": false } } ], "pval_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6586 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6608 }, "loc_ghost": false } } ], "psig_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6586 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 145, "pos_bol": 6586, "pos_cnum": 6608 }, "loc_ghost": false } }, { "psig_desc": [ "Psig_value", { "pval_name": { "loc2": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6875 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6879 }, "loc_ghost": false }, "txt2": "wait" }, "pval_type": { "ptyp_desc": [ "Ptyp_arrow", [ "Nolabel" ], { "ptyp_desc": [ "Ptyp_constr", "t", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6882 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6883 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, { "ptyp_desc": [ "Ptyp_arrow", [ "Nolabel" ], { "ptyp_desc": [ "Ptyp_constr", "Mutext", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6887 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6894 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, { "ptyp_desc": [ "Ptyp_constr", "unit", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6898 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6902 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] } ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6887 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6902 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] } ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6882 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6902 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, "pval_prim": [], "pval_attributes": [ { "attr_name": { "loc2": { "loc_start": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_end": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_ghost": true }, "txt2": "ocaml.doc" }, "attr_payload": [ "PStr", [ { "pstr_desc": [ "Pstr_eval", { "pexp_desc": [ "Pexp_constant", [ "Pconst_string", "The call [wait c m] is permitted only if [m] is the mutex associated\n with the condition variable [c], and only if [m] is currently locked.\n This call atomically unlocks the mutex [m] and suspends the\n current thread on the condition variable [c]. This thread can\n later be woken up after the condition variable [c] has been signaled\n via {!signal} or {!broadcast}; however, it can also be woken up for\n no reason. The mutex [m] is locked again before [wait] returns. One\n cannot assume that the property {i P} associated with the condition\n variable [c] holds when [wait] returns; one must explicitly test\n whether {i P} holds after calling [wait]. ", { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 152, "pos_bol": 6903, "pos_cnum": 6903 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 161, "pos_bol": 7529, "pos_cnum": 7576 }, "loc_ghost": false }, null ] ], "pexp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 152, "pos_bol": 6903, "pos_cnum": 6903 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 161, "pos_bol": 7529, "pos_cnum": 7576 }, "loc_ghost": false }, "pexp_loc_stack": [], "pexp_attributes": [] }, [] ], "pstr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 152, "pos_bol": 6903, "pos_cnum": 6903 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 161, "pos_bol": 7529, "pos_cnum": 7576 }, "loc_ghost": false } } ] ], "attr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 152, "pos_bol": 6903, "pos_cnum": 6903 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 161, "pos_bol": 7529, "pos_cnum": 7576 }, "loc_ghost": false } } ], "pval_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6871 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6902 }, "loc_ghost": false } } ], "psig_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6871 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 151, "pos_bol": 6871, "pos_cnum": 6902 }, "loc_ghost": false } }, { "psig_desc": [ "Psig_value", { "pval_name": { "loc2": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7582 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7588 }, "loc_ghost": false }, "txt2": "signal" }, "pval_type": { "ptyp_desc": [ "Ptyp_arrow", [ "Nolabel" ], { "ptyp_desc": [ "Ptyp_constr", "t", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7591 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7592 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, { "ptyp_desc": [ "Ptyp_constr", "unit", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7596 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7600 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] } ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7591 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7600 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, "pval_prim": [], "pval_attributes": [ { "attr_name": { "loc2": { "loc_start": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_end": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_ghost": true }, "txt2": "ocaml.doc" }, "attr_payload": [ "PStr", [ { "pstr_desc": [ "Pstr_eval", { "pexp_desc": [ "Pexp_constant", [ "Pconst_string", "[signal c] wakes up one of the threads waiting on the condition\n variable [c], if there is one. If there is none, this call has\n no effect.\n\n It is recommended to call [signal c] inside a critical section,\n that is, while the mutex [m] associated with [c] is locked. ", { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 164, "pos_bol": 7601, "pos_cnum": 7601 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 169, "pos_bol": 7816, "pos_cnum": 7881 }, "loc_ghost": false }, null ] ], "pexp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 164, "pos_bol": 7601, "pos_cnum": 7601 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 169, "pos_bol": 7816, "pos_cnum": 7881 }, "loc_ghost": false }, "pexp_loc_stack": [], "pexp_attributes": [] }, [] ], "pstr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 164, "pos_bol": 7601, "pos_cnum": 7601 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 169, "pos_bol": 7816, "pos_cnum": 7881 }, "loc_ghost": false } } ] ], "attr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 164, "pos_bol": 7601, "pos_cnum": 7601 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 169, "pos_bol": 7816, "pos_cnum": 7881 }, "loc_ghost": false } } ], "pval_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7578 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7600 }, "loc_ghost": false } } ], "psig_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7578 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 163, "pos_bol": 7578, "pos_cnum": 7600 }, "loc_ghost": false } }, { "psig_desc": [ "Psig_value", { "pval_name": { "loc2": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7887 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7896 }, "loc_ghost": false }, "txt2": "broadcast" }, "pval_type": { "ptyp_desc": [ "Ptyp_arrow", [ "Nolabel" ], { "ptyp_desc": [ "Ptyp_constr", "t", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7899 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7900 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, { "ptyp_desc": [ "Ptyp_constr", "unit", [] ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7904 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7908 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] } ], "ptyp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7899 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7908 }, "loc_ghost": false }, "ptyp_loc_stack": [], "ptyp_attributes": [] }, "pval_prim": [], "pval_attributes": [ { "attr_name": { "loc2": { "loc_start": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_end": { "pos_fname": "_none_", "pos_lnum": 0, "pos_bol": 0, "pos_cnum": -1 }, "loc_ghost": true }, "txt2": "ocaml.doc" }, "attr_payload": [ "PStr", [ { "pstr_desc": [ "Pstr_eval", { "pexp_desc": [ "Pexp_constant", [ "Pconst_string", "[broadcast c] wakes up all threads waiting on the condition\n variable [c]. If there are none, this call has no effect.\n\n It is recommended to call [broadcast c] inside a critical section,\n that is, while the mutex [m] associated with [c] is locked. ", { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 172, "pos_bol": 7909, "pos_cnum": 7909 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 176, "pos_bol": 8104, "pos_cnum": 8169 }, "loc_ghost": false }, null ] ], "pexp_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 172, "pos_bol": 7909, "pos_cnum": 7909 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 176, "pos_bol": 8104, "pos_cnum": 8169 }, "loc_ghost": false }, "pexp_loc_stack": [], "pexp_attributes": [] }, [] ], "pstr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 172, "pos_bol": 7909, "pos_cnum": 7909 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 176, "pos_bol": 8104, "pos_cnum": 8169 }, "loc_ghost": false } } ] ], "attr_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 172, "pos_bol": 7909, "pos_cnum": 7909 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 176, "pos_bol": 8104, "pos_cnum": 8169 }, "loc_ghost": false } } ], "pval_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7883 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7908 }, "loc_ghost": false } } ], "psig_loc": { "loc_start": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7883 }, "loc_end": { "pos_fname": "./stdlib/condition.mli", "pos_lnum": 171, "pos_bol": 7883, "pos_cnum": 7908 }, "loc_ghost": false } } ]