1. 09 May, 2007 6 commits
    • Hallvard Furuseth's avatar
      Since we only have LDAP_MAXTHR thread_keys, allow max LDAP_MAXTHR · 810b2389
      Hallvard Furuseth authored
      threads per pool, even when ltp_max_count <= 0 ("unlimited").
      Keep ltp_max_count in range [0, LDAP_MAXTHR].
      810b2389
    • Hallvard Furuseth's avatar
      Make ldap_int_thread_userctx_t.ltu_key[] a proper NULL-terminated array. · f0a15114
      Hallvard Furuseth authored
      (setkey/getkey expected that, but purgekey could set a NULL in the middle.)
      Added some checks for input key!=NULL.
      
      API changes, need review - I'm not sure what's indented here:
      - setkey(data=NULL, kfree!=NULL) searched as if intended to reset
        the key, but updated by setting the key.  Now always updates.
      - setkey(key=<not found>, data=NULL) could return either success or
        failure.  Now succeeds iff (data == NULL && kfree == NULL).
      f0a15114
    • Hallvard Furuseth's avatar
      thread_keys is a (poor) open-addessed hash table, but it lacked a · f5da908c
      Hallvard Furuseth authored
      "deleted item" mark.  Add DELETED_THREAD_CTX.
      Also improve the hash function a bit, and make the hash unsigned.
      f5da908c
    • Hallvard Furuseth's avatar
      Protect thread_keys[] with ldap_pvt_thread_pool_mutex, except in · 8a928252
      Hallvard Furuseth authored
      ldap_pvt_thread_pool_purgekey() which may only be called during pauses.
      
      Thus, also wait for pauses to finish before accessing thread_keys in
      ldap_int_thread_pool_wrapper().  This may prevent pending tasks from
      being started when a pause had been requested, which seems to have been
      possible.  If that was a feature, we can split ltp_pause==1 in 2 states:
      in pause (causes wait), and pause requested.
      
      Also move 'thread_keys[].id = <thread id>' from pool_submit to
      pool_wrapper.  Until pool_wrapper set the ctx as well, thread context
      lookup would just return NULL anyway.
      8a928252
    • Hallvard Furuseth's avatar
      Replace state LDAP_INT_THREAD_POOL_PAUSING with member ltp_pause, · 92afeb8e
      Hallvard Furuseth authored
      so a pause will work during states FINISHING and STOPPING.
      
      Add missing waits and signals, and move waits in pool_wrapper().
      Replace if(test) with while(test) when waiting for the multi-purpose
      condition variable ltp_cond.
      92afeb8e
    • Hallvard Furuseth's avatar
      ITS#4943: · 9e9bf22a
      Hallvard Furuseth authored
      In ldap_pvt_thread_pool_submit(), when backing out of thread creation:
        ltp_pending_count '++' -> '--'.  Signal if there are no more threads.
      In ldap_int_thread_pool_wrapper():
        if() -> assert() where false would result in eternal loop.
      9e9bf22a
  2. 05 Apr, 2007 1 commit
  3. 01 Apr, 2007 1 commit
  4. 28 Jan, 2007 1 commit
  5. 27 Jan, 2007 1 commit
  6. 25 Jan, 2007 2 commits
  7. 02 Jan, 2007 1 commit
  8. 14 Sep, 2006 1 commit
  9. 02 May, 2006 1 commit
  10. 29 Apr, 2006 1 commit
  11. 02 Apr, 2006 1 commit
  12. 24 Jan, 2006 1 commit
  13. 18 Jan, 2006 1 commit
  14. 15 Jan, 2006 2 commits
  15. 03 Jan, 2006 1 commit
  16. 28 Oct, 2005 1 commit
  17. 27 Oct, 2005 1 commit
  18. 16 Oct, 2005 2 commits
  19. 12 Oct, 2005 1 commit
  20. 17 Sep, 2005 1 commit
    • Hallvard Furuseth's avatar
      Add thread debugging wrapper thr_debug.c and ldap_thr_debug.h in libldap_r/, · 123948bd
      Hallvard Furuseth authored
      enabled with LDAP_THREAD_DEBUG (cpp macro and environment variable):
      
      Move any ldap_pvt_* definitions from ldap_int_thread.h to ldap_pvt_thread.h.
      #define ldap_int_thread_equal/ldap_pvt_thread_equal instead of tpool.c:TID_EQ.
      Define some ldap_debug_*_t types, and LDAP_UINTPTR_T, in ldap_int_thread.h.
      ldap_int_thread.h/ldap_pvt_thread.h can now be included multiple times, giving
      different results depending on whether libldap_r/ldap_thr_debug.h was included.
      Add some cleanup and some preprocessor hacks.
      #define LDAP_THREAD*_IMPLEMENTATION in libldap_r/*.c, used by ldap_thr_debug.h.
      Add PTHREAD_MUTEX_ERRORCHECK/PTHREAD_MUTEX_ERRORCHECK_NP in thr_posix.c.
      123948bd
  21. 01 Sep, 2005 2 commits
  22. 23 Aug, 2005 2 commits
  23. 11 Jul, 2005 1 commit
  24. 06 Jul, 2005 1 commit
  25. 22 Apr, 2005 1 commit
  26. 07 Mar, 2005 1 commit
  27. 01 Jan, 2005 1 commit
  28. 04 Mar, 2004 1 commit
  29. 01 Jan, 2004 1 commit
  30. 26 Nov, 2003 1 commit