]> git.sur5r.net Git - openldap/commitdiff
Fixup handle_pause()
authorHoward Chu <hyc@openldap.org>
Sun, 9 Apr 2017 14:39:44 +0000 (15:39 +0100)
committerHoward Chu <hyc@openldap.org>
Sun, 9 Apr 2017 14:39:44 +0000 (15:39 +0100)
Return -1 if running on the main thread - which means there
are no worker threads to pause.

libraries/libldap_r/tpool.c

index b785631213ced2581953076333b6e1ed320244fd..1b6087f2b844c67fdf8bb1ffe04a5e9bb2b6c75c 100644 (file)
@@ -1031,6 +1031,8 @@ handle_pause( ldap_pvt_thread_pool_t *tpool, int pause_type )
        {
                ldap_int_thread_userctx_t *ctx = ldap_pvt_thread_pool_context();
                pq = ctx->ltu_pq;
+               if ( !pq )
+                       return(-1);
        }
 
        /* Let pool_unidle() ignore requests for new pauses */