Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Nov 29, 2024
1 parent f551fae commit 72af040
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,8 @@ namespace bx
void* ThreadInternal::threadFunc(void* _arg)
{
Thread* thread = (Thread*)_arg;
union
{
void* ptr;
int32_t i;
} cast;
cast.i = thread->entry();
return cast.ptr;
intptr_t result = thread->entry();
return bitCast<void*>(result);
}
#endif // BX_PLATFORM_

Expand Down Expand Up @@ -219,13 +214,9 @@ namespace bx
CloseHandle(ti->m_handle);
ti->m_handle = INVALID_HANDLE_VALUE;
#elif BX_PLATFORM_POSIX
union
{
void* ptr;
int32_t i;
} cast;
pthread_join(ti->m_handle, &cast.ptr);
m_exitCode = cast.i;
void* ptr;
pthread_join(ti->m_handle, &ptr);
m_exitCode = narrowCast<int32_t>(bitCast<intptr_t>(ptr) );
ti->m_handle = 0;
#endif // BX_PLATFORM_

Expand Down

0 comments on commit 72af040

Please sign in to comment.