[ruby-cvs:69647] normal:r62466 (trunk): thread_pthread.c: shorten and fix thread cache implementation

normal at ruby-lang.org normal at ruby-lang.org
Sun Feb 18 16:54:10 JST 2018


normal	2018-02-18 16:54:10 +0900 (Sun, 18 Feb 2018)

  New Revision: 62466

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62466

  Log:
    thread_pthread.c: shorten and fix thread cache implementation
    
    Update to use ccan/list for constant-time delete on expiry and
    avoid malloc.  We must also initialize th->thread_id upon thread
    reuse so Thread#name= works immediately upon thread creation.
    
    We must also reinitialize the cache mutex and list_head on
    fork like we do with GVL and timer thread mutexes.
    While we're at it, use monotonic clock for timeout to avoid
    system time changes.
    
    "make exam TESTS='-x test_time_tz'" passes with USE_THREAD_CACHE
    enabled (but remains off, here).

  Modified files:
    trunk/thread_pthread.c


More information about the ruby-cvs mailing list