More thread_t fixes (dont use a 32 bit type to hold a 64 bit handle).
This commit is contained in:
@@ -93,13 +93,13 @@ namespace detail
|
||||
{
|
||||
struct thread_context_cache
|
||||
{
|
||||
unsigned tid{ 0 };
|
||||
thread_t tid{ 0 };
|
||||
thread_context *object{ nullptr };
|
||||
}tcontext;
|
||||
}cache;
|
||||
};
|
||||
|
||||
void timer_proc(unsigned);
|
||||
void timer_proc(thread_t);
|
||||
void window_proc_dispatcher(Display*, nana::detail::msg_packet_tag&);
|
||||
void window_proc_for_packet(Display *, nana::detail::msg_packet_tag&);
|
||||
void window_proc_for_xevent(Display*, XEvent&);
|
||||
@@ -352,7 +352,7 @@ namespace detail
|
||||
|
||||
}
|
||||
|
||||
void timer_proc(unsigned tid)
|
||||
void timer_proc(thread_t tid)
|
||||
{
|
||||
nana::detail::platform_spec::instance().timer_proc(tid);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace detail
|
||||
{
|
||||
struct thread_context_cache
|
||||
{
|
||||
unsigned tid{ 0 };
|
||||
thread_t tid{ 0 };
|
||||
thread_context *object{ nullptr };
|
||||
}tcontext;
|
||||
}cache;
|
||||
@@ -245,7 +245,7 @@ namespace detail
|
||||
|
||||
|
||||
/// @brief increament the number of windows in the thread id
|
||||
int bedrock::inc_window(unsigned tid)
|
||||
int bedrock::inc_window(thread_t tid)
|
||||
{
|
||||
//impl refers to the object of private_impl, the object is created when bedrock is creating.
|
||||
private_impl * impl = instance().impl_;
|
||||
@@ -255,7 +255,7 @@ namespace detail
|
||||
return (cnt < 0 ? cnt = 1 : ++cnt);
|
||||
}
|
||||
|
||||
auto bedrock::open_thread_context(unsigned tid) -> thread_context*
|
||||
auto bedrock::open_thread_context(thread_t tid) -> thread_context*
|
||||
{
|
||||
if(0 == tid) tid = nana::system::this_thread_id();
|
||||
std::lock_guard<decltype(impl_->mutex)> lock(impl_->mutex);
|
||||
@@ -269,7 +269,7 @@ namespace detail
|
||||
return context;
|
||||
}
|
||||
|
||||
auto bedrock::get_thread_context(unsigned tid) -> thread_context *
|
||||
auto bedrock::get_thread_context(thread_t tid) -> thread_context *
|
||||
{
|
||||
if(0 == tid) tid = nana::system::this_thread_id();
|
||||
|
||||
@@ -289,7 +289,7 @@ namespace detail
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void bedrock::remove_thread_context(unsigned tid)
|
||||
void bedrock::remove_thread_context(thread_t tid)
|
||||
{
|
||||
if(0 == tid) tid = nana::system::this_thread_id();
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace detail
|
||||
|
||||
void bedrock::pump_event(window condition_wd, bool is_modal)
|
||||
{
|
||||
const unsigned tid = ::GetCurrentThreadId();
|
||||
thread_t tid = ::GetCurrentThreadId();
|
||||
auto context = this->open_thread_context(tid);
|
||||
if(0 == context->window_count)
|
||||
{
|
||||
|
||||
@@ -273,10 +273,10 @@ namespace detail
|
||||
//class revertible_mutex
|
||||
struct thread_refcount
|
||||
{
|
||||
unsigned tid; //Thread ID
|
||||
thread_t tid; //Thread ID
|
||||
std::vector<unsigned> callstack_refs;
|
||||
|
||||
thread_refcount(unsigned thread_id, unsigned refs)
|
||||
thread_refcount(thread_t thread_id, unsigned refs)
|
||||
: tid(thread_id)
|
||||
{
|
||||
callstack_refs.push_back(refs);
|
||||
@@ -287,7 +287,7 @@ namespace detail
|
||||
{
|
||||
std::recursive_mutex mutex;
|
||||
|
||||
unsigned thread_id; //Thread ID
|
||||
thread_t thread_id; //Thread ID
|
||||
unsigned refs; //Ref count
|
||||
|
||||
std::vector<thread_refcount> records;
|
||||
@@ -1442,7 +1442,7 @@ namespace detail
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void window_manager::remove_trash_handle(unsigned tid)
|
||||
void window_manager::remove_trash_handle(thread_t tid)
|
||||
{
|
||||
//Thread-Safe Required!
|
||||
std::lock_guard<mutex_type> lock(mutex_);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace nana
|
||||
}
|
||||
}
|
||||
|
||||
void delete_trash(unsigned thread_id)
|
||||
void delete_trash(thread_t thread_id)
|
||||
{
|
||||
if (0 == thread_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user