More thread_t fixes (dont use a 32 bit type to hold a 64 bit handle).

This commit is contained in:
unitrunker
2018-01-22 11:46:29 -06:00
parent e9c381e1de
commit f2baba7c77
9 changed files with 49 additions and 44 deletions

View File

@@ -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);
}

View File

@@ -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)
{

View File

@@ -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_);

View File

@@ -153,7 +153,7 @@ namespace nana
}
}
void delete_trash(unsigned thread_id)
void delete_trash(thread_t thread_id)
{
if (0 == thread_id)
{