diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-06-22 17:22:10 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2018-07-24 17:38:27 +0200 |
commit | f23cac39b36b026650e0922c78fe0fd3fe567e35 (patch) | |
tree | dea01d55206f451288a9b90fb2f5e40d04dc56b0 /lib | |
parent | aa9b64eccfd037941512bad108c4e3946714a502 (diff) | |
download | samba-f23cac39b36b026650e0922c78fe0fd3fe567e35.tar.gz |
pthreadpool: add a comment about a further optimization in pthreadpool_tevent_job_destructor()
This seems to be a really rare race, it's likely that the immediate
event will still trigger and cleanup.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pthreadpool/pthreadpool_tevent.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/pthreadpool/pthreadpool_tevent.c b/lib/pthreadpool/pthreadpool_tevent.c index 3b502a7cc5a..94b6b9ded8f 100644 --- a/lib/pthreadpool/pthreadpool_tevent.c +++ b/lib/pthreadpool/pthreadpool_tevent.c @@ -492,6 +492,23 @@ static int pthreadpool_tevent_job_destructor(struct pthreadpool_tevent_job *job) } /* + * TODO?: We could further improve this by adjusting + * tevent_threaded_schedule_immediate_destructor() + * and allow TALLOC_FREE() during its time + * in the main_ev->scheduled_immediates list. + * + * PTHREAD_TEVENT_JOB_THREAD_FENCE(job); + * if (state->needs_fence.signaled) { + * * + * * The signal function is completed + * * in future we may be allowed + * * to call TALLOC_FREE(job->im). + * * + * TALLOC_FREE(job->im); + * } + */ + + /* * pthreadpool_tevent_job_orphan() already removed * it from pool->jobs. And we don't need try * pthreadpool_cancel_job() again. |