Files
blis/frame/thread
Field G. Van Zee 4603324eb0 Init/finalize via bli_pthread_switch_t API (#634).
Details:
- Defined and implemented a new pthread-like abstract datatype and API
  in bli_pthread.c. The new type, bli_pthread_switch_t, is similar to
  bli_pthread_once_t in some respects. The idea is that like a switch in
  your home that controls a light or ceiling fan, it can either be on or 
  off. The switch starts in the off state. Moving from one state to the 
  other (on to off; off to on) causes some action (i.e., a startup or
  shutdown function) to be executed. Trying to move from one state to 
  the same state (on to on; off to off) is safe in that it results in
  no action. Unlike bli_pthread_once(), the API for bli_pthread_switch_t 
  contains both _on() and _off() interfaces. Also, unlike the _once()
  function, the _on() and _off() functions return error codes so that
  the 'int' error code returned from the startup or shutdown functions
  may be passed back to the caller. Thanks to Devin Matthews for his
  input and feedback on this feature.
- Replaced the previous implementation of bli_init_once() and 
  bli_finalize_once() -- both of which used bli_pthread_once() -- with 
  ones that rely upon bli_pthread_switch_on() and _switch_off(),
  respectively. This also required updating the return types of 
  _init_apis() and _finalize_apis() to match the function pointer type 
  required by bli_pthread_switch_on()/_switch_off().
- Comment updates.
2022-05-19 14:07:03 -05:00
..