Revert "pthreadpool: add pthreadpool_tevent_[current_job_]per_thread_cwd()"
authorRalph Boehme <slow@samba.org>
Mon, 7 Jan 2019 20:27:19 +0000 (21:27 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 11 Jan 2019 22:11:13 +0000 (23:11 +0100)
This reverts commit 12a45ee1a66379ba7562729b835ce0e2e4bfb3b3.

See the discussion in

https://lists.samba.org/archive/samba-technical/2018-December/131731.html

for the reasoning behind this revert.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/pthreadpool/pthreadpool_tevent.c
lib/pthreadpool/pthreadpool_tevent.h

index b0a757a..5ccff62 100644 (file)
@@ -211,8 +211,6 @@ struct pthreadpool_tevent_job {
                 */
                bool signaled;
        } needs_fence;
-
-       bool per_thread_cwd;
 };
 
 static int pthreadpool_tevent_destructor(struct pthreadpool_tevent *pool);
@@ -286,15 +284,6 @@ size_t pthreadpool_tevent_queued_jobs(struct pthreadpool_tevent *pool)
        return pthreadpool_queued_jobs(pool->pool);
 }
 
-bool pthreadpool_tevent_per_thread_cwd(struct pthreadpool_tevent *pool)
-{
-       if (pool->pool == NULL) {
-               return false;
-       }
-
-       return pthreadpool_per_thread_cwd(pool->pool);
-}
-
 static int pthreadpool_tevent_destructor(struct pthreadpool_tevent *pool)
 {
        struct pthreadpool_tevent_job *job = NULL;
@@ -713,7 +702,6 @@ struct tevent_req *pthreadpool_tevent_job_send(
                return tevent_req_post(req, ev);
        }
        PTHREAD_TEVENT_JOB_THREAD_FENCE_INIT(job);
-       job->per_thread_cwd = pthreadpool_tevent_per_thread_cwd(pool);
        talloc_set_destructor(job, pthreadpool_tevent_job_destructor);
        DLIST_ADD_END(job->pool->jobs, job);
        job->state = state;
@@ -785,20 +773,6 @@ bool pthreadpool_tevent_current_job_continue(void)
        return true;
 }
 
-bool pthreadpool_tevent_current_job_per_thread_cwd(void)
-{
-       if (current_job == NULL) {
-               /*
-                * Should only be called from within
-                * the job function.
-                */
-               abort();
-               return false;
-       }
-
-       return current_job->per_thread_cwd;
-}
-
 static void pthreadpool_tevent_job_fn(void *private_data)
 {
        struct pthreadpool_tevent_job *job =
index ff2ab7c..37e491e 100644 (file)
@@ -31,7 +31,6 @@ int pthreadpool_tevent_init(TALLOC_CTX *mem_ctx, unsigned max_threads,
 
 size_t pthreadpool_tevent_max_threads(struct pthreadpool_tevent *pool);
 size_t pthreadpool_tevent_queued_jobs(struct pthreadpool_tevent *pool);
-bool pthreadpool_tevent_per_thread_cwd(struct pthreadpool_tevent *pool);
 
 /*
  * return true - if tevent_req_cancel() was called.
@@ -47,12 +46,6 @@ bool pthreadpool_tevent_current_job_orphaned(void);
  */
 bool pthreadpool_tevent_current_job_continue(void);
 
-/*
- * return true if the current job can rely on a per thread
- * current working directory.
- */
-bool pthreadpool_tevent_current_job_per_thread_cwd(void);
-
 struct tevent_req *pthreadpool_tevent_job_send(
        TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        struct pthreadpool_tevent *pool,