Drop recursive mutex code since the running kernel may not support it
(STR #1575) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5647 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
2fcd3610d5
commit
b7be6fb47e
3
CHANGES
3
CHANGES
@ -1,6 +1,9 @@
|
||||
CHANGES IN FLTK 1.1.8
|
||||
|
||||
- Fl::awake() could block on X11 and OSX (STR #1537)
|
||||
- Dropped "native" recursive POSIX mutex support since the kernel's
|
||||
underlying implementation may not support it even if the C
|
||||
library does (STR #1575)
|
||||
- WIN32 did check callbacks after the event processing instead of
|
||||
before as documented (STR #1535)
|
||||
- Fl_File_Chooser now hides the window before doing a callback
|
||||
|
@ -130,28 +130,9 @@ void Fl::awake(void* msg) {
|
||||
# include <fcntl.h>
|
||||
# include <pthread.h>
|
||||
|
||||
# ifdef PTHREAD_MUTEX_RECURSIVE_NP
|
||||
// Linux supports recursive locks, use them directly:
|
||||
|
||||
static bool minit;
|
||||
static pthread_mutex_t fltk_mutex;
|
||||
// this is needed for the Fl_Mutex constructor:
|
||||
pthread_mutexattr_t Fl_Mutex_attrib = {PTHREAD_MUTEX_RECURSIVE_NP};
|
||||
|
||||
static void lock_function() {
|
||||
if (!minit) {
|
||||
pthread_mutex_init(&fltk_mutex, &Fl_Mutex_attrib);
|
||||
minit = true;
|
||||
}
|
||||
pthread_mutex_lock(&fltk_mutex);
|
||||
}
|
||||
|
||||
void Fl::unlock() {
|
||||
pthread_mutex_unlock(&fltk_mutex);
|
||||
}
|
||||
|
||||
# else // !PTHREAD_MUTEX_RECURSIVE_NP
|
||||
// Make a recursive lock out of the pthread mutex:
|
||||
// Make a recursive lock out of the pthread mutex; we don't use "native"
|
||||
// recursive locks since they may not be implemented by the running kernel
|
||||
// (see discussions in STR #1575)
|
||||
|
||||
static pthread_mutex_t fltk_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_t owner;
|
||||
@ -169,8 +150,6 @@ void Fl::unlock() {
|
||||
if (!--counter) pthread_mutex_unlock(&fltk_mutex);
|
||||
}
|
||||
|
||||
# endif // PTHREAD_MUTEX_RECURSIVE_NP
|
||||
|
||||
// Pipe for thread messaging...
|
||||
static int thread_filedes[2];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user