cwThreadMach.h : Add comments.

This commit is contained in:
kevin 2022-06-12 12:15:32 -04:00
parent 063f0ebbac
commit ca0a61d7f8

View File

@ -8,11 +8,23 @@ namespace cw
typedef handle<struct thread_mach_str> handle_t; typedef handle<struct thread_mach_str> handle_t;
typedef thread::cbFunc_t threadFunc_t; typedef thread::cbFunc_t threadFunc_t;
// Create a thread machine instance.
// contextArray[ threadN ][ contextRecdByteN ] is an optional blob consisting of 'threadN' records each of size 'contextRecdByteN'.
// Each of the records then becomes the entity which is used as the 'arg' value in the callback for the first 'threadN' threads.
rc_t create( handle_t& hRef, threadFunc_t threadFunc=nullptr, void* contextArray=nullptr, unsigned contexRecdByteN=0, unsigned threadN=0 ); rc_t create( handle_t& hRef, threadFunc_t threadFunc=nullptr, void* contextArray=nullptr, unsigned contexRecdByteN=0, unsigned threadN=0 );
rc_t destroy( handle_t& hRef ); rc_t destroy( handle_t& hRef );
// Create an additional thread. Note that the additional thread will be started by the next
// call to 'start()'.
rc_t add( handle_t h, threadFunc_t threadFunc, void* arg ); rc_t add( handle_t h, threadFunc_t threadFunc, void* arg );
// Start all threads
rc_t start( handle_t h ); rc_t start( handle_t h );
// Stop all threads.
rc_t stop( handle_t h ); rc_t stop( handle_t h );
// Check if all threads are shutdown.
bool is_shutdown( handle_t h ); bool is_shutdown( handle_t h );
} }
} }