diff --git a/doc/developer-guide/api/functions/TSContCreate.en.rst b/doc/developer-guide/api/functions/TSContCreate.en.rst index 774343239e4..716e21e6af4 100644 --- a/doc/developer-guide/api/functions/TSContCreate.en.rst +++ b/doc/developer-guide/api/functions/TSContCreate.en.rst @@ -32,3 +32,8 @@ Synopsis Description =========== +Creates a continuation, which can be destroyed with :func:`TSContDestroy`. +**Note:** when a mutex is passed to a call to this function, it creates a +reference to the mutex. The mutex will be destroyed when the number of +continuations refering to it becomes zero (due to calls to :func:`TSContDestroy`). +:func:`TSMutexDestroy` must not be called for the mutex. diff --git a/doc/developer-guide/api/functions/TSMutexDestroy.en.rst b/doc/developer-guide/api/functions/TSMutexDestroy.en.rst index ca841085046..4623684982e 100644 --- a/doc/developer-guide/api/functions/TSMutexDestroy.en.rst +++ b/doc/developer-guide/api/functions/TSMutexDestroy.en.rst @@ -34,4 +34,6 @@ Description =========== Destroys the indicated :arg:`mutex` previously created via -:func:`TSMutexCreate`. +:func:`TSMutexCreate`. **Note:** Do not call this function for a mutex that +was passed to :func:`TSContCreate` as a parameter. It will be destroyed by call(s) +to :func:`TSContDestroy`. diff --git a/iocore/eventsystem/UnixEThread.cc b/iocore/eventsystem/UnixEThread.cc index 115ae6d86f4..cadeea97743 100644 --- a/iocore/eventsystem/UnixEThread.cc +++ b/iocore/eventsystem/UnixEThread.cc @@ -139,6 +139,7 @@ EThread::process_event(Event *e, int calling_code) EventQueueExternal.enqueue_local(e); } else { if (e->cancelled) { + MUTEX_RELEASE(lock); free_event(e); return; }