diff options
| -rw-r--r-- | CHANGES | 3 | ||||
| -rw-r--r-- | src/Fl_lock.cxx | 27 |
2 files changed, 6 insertions, 24 deletions
@@ -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 diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx index 6f3b44f2c..6db23cdc5 100644 --- a/src/Fl_lock.cxx +++ b/src/Fl_lock.cxx @@ -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]; |
