Skip to content

Commit

Permalink
MDC and NDC availablity no longer depend on APR thread support (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
swebb2066 authored Nov 22, 2023
1 parent 587f493 commit 0f20ec7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/cpp/threadspecificdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ ThreadSpecificData* ThreadSpecificData::getCurrentData()
void* pData = NULL;
apr_threadkey_private_get(&pData, APRInitializer::getTlsKey());
return (ThreadSpecificData*) pData;
#elif LOG4CXX_HAS_THREAD_LOCAL
thread_local ThreadSpecificData data;
return &data;
#else
return &getDataNoThreads();
#endif
Expand Down Expand Up @@ -167,6 +170,8 @@ ThreadSpecificData* ThreadSpecificData::createCurrentData()
}

return newData;
#elif LOG4CXX_HAS_THREAD_LOCAL
return getCurrentData();
#else
return 0;
#endif
Expand Down

0 comments on commit 0f20ec7

Please sign in to comment.