mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Cleaned up more of the gui core code
--HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402564
This commit is contained in:
parent
d1487bb141
commit
9f7abda42f
@ -63,9 +63,9 @@ namespace dlib
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
dlib::mutex* global_mutex()
|
||||
const shared_ptr_thread_safe<dlib::mutex>& global_mutex()
|
||||
{
|
||||
static dlib::mutex* m = new dlib::mutex;
|
||||
static shared_ptr_thread_safe<dlib::mutex> m(new dlib::mutex);
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -118,6 +118,8 @@ namespace dlib
|
||||
// processing.
|
||||
thread_id_type event_thread_id;
|
||||
|
||||
shared_ptr_thread_safe<dlib::mutex> reference_to_global_mutex;
|
||||
|
||||
event_handler_thread(
|
||||
) :
|
||||
dlog("dlib.gui_core"),
|
||||
@ -138,7 +140,8 @@ namespace dlib
|
||||
in_ime_composition(false),
|
||||
event_thread_started(false),
|
||||
window_close_signaler(window_table.get_mutex()),
|
||||
et_signaler(window_table.get_mutex())
|
||||
et_signaler(window_table.get_mutex()),
|
||||
reference_to_global_mutex(global_mutex())
|
||||
{
|
||||
status = uninitialized;
|
||||
}
|
||||
@ -185,7 +188,6 @@ namespace dlib
|
||||
wait();
|
||||
}
|
||||
|
||||
delete global_mutex();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -48,9 +48,9 @@ namespace dlib
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
dlib::mutex* global_mutex()
|
||||
const shared_ptr_thread_safe<dlib::mutex>& global_mutex()
|
||||
{
|
||||
static dlib::mutex* m = new dlib::mutex;
|
||||
static shared_ptr_thread_safe<dlib::mutex> m(new dlib::mutex);
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -94,6 +94,8 @@ namespace dlib
|
||||
queue_of_user_events user_events;
|
||||
queue_of_user_events user_events_temp;
|
||||
|
||||
shared_ptr_thread_safe<dlib::mutex> reference_to_global_mutex;
|
||||
|
||||
event_handler_thread(
|
||||
) :
|
||||
dlog("dlib.gui_core"),
|
||||
@ -106,7 +108,8 @@ namespace dlib
|
||||
num_lock_mask(0),
|
||||
scroll_lock_mask(0),
|
||||
window_close_signaler(window_table.get_mutex()),
|
||||
et_signaler(window_table.get_mutex())
|
||||
et_signaler(window_table.get_mutex()),
|
||||
reference_to_global_mutex(global_mutex())
|
||||
{
|
||||
auto_mutex M(window_table.get_mutex());
|
||||
|
||||
@ -166,7 +169,7 @@ namespace dlib
|
||||
}
|
||||
}
|
||||
|
||||
delete global_mutex();
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user