TSContCall

    Description

    Call the continuation contp as if from a hook with the event type event and data of edata. Presuming contp was created in a manner like:

    Therefore there is a function:

    If there is a mutex associated with contp, assumes that mutex is held already. TSContCall() will directly call the handler associated with the continuation. It will return the value returned by the handler in contp.

    If contp has a mutex, the plugin must acquire the lock on the mutex for contp before calling . See TSContMutexGet() and for mechanisms for doing this.

    Note mutexes returned by TSMutexCreate() are recursive mutexes, therefore if the lock is already held on the thread of execution acquiring the lock again is very fast. Mutexes are also shareable so that the same mutex can be used for multiple continuations.:

    In this example case, cont1 can assume the lock for is held. This should be considered carefully because for the same reason any thread protection between the continuations is removed. This works well for tightly coupled continuations that always operate in a fixed sequence.