Re: xmutex vs xlock
Vladimir Tzankov <[email protected]>
| Newsgroups | gmane.lisp.clisp.devel |
|---|---|
| Message-ID | <CAHWYE6L4LAMgH8H8mTVax+mL_fKkPXu6S+gU9k08YKgxOV3LWA@mail.gmail.com> |
On Mon, Jun 5, 2017 at 12:24 AM, Compro Prasad <[email protected]> wrote: > I don't see the point in having "xmutex_t" defined as "xlock_t" and > "xmutex_raw_t" defined as "pthread_mutex_t". I mean how is xmutex_t > related to xmutex_raw_t ? I see it as a redundant definition which > makes the real definition look clumsy. > xlock_t helps to implement THREAD-INTERRUPT (and thus CALL-WITH-TIMEOUT, THREAD-KILL) in safe way. THREAD-INTERRUPT is implemented by sending SIGUSR1 to the thread which then is interrupted at so called GC_SAFE regions. Waiting with pthread_mutex_lock is such GC_SAFE region but interrupting it may/will leave the pthread_mutex_t internals in inconsistent state. xlock_t helps with unblocking threads waiting on mutexes when interrupt should be handled. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ clisp-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-devel