Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams committed Aug 9, 2016
1 parent cd0d600 commit 2e0332a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
36 changes: 14 additions & 22 deletions src/vm/threadpoolrequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,13 @@ class ManagedPerAppDomainTPCount : public IPerAppDomainTPCount {
void DispatchWorkItem(bool* foundWork, bool* wasNotRecalled);

private:
struct {
ADID m_id;
TPIndex m_index;
};
struct {
DECLSPEC_ALIGN(64) struct {
BYTE padding1[64 - sizeof(LONG)];
// Only use with VolatileLoad+VolatileStore+FastInterlockCompareExchange
LONG m_numRequestsPending;
BYTE padding2[64];
};
ADID m_id;
TPIndex m_index;
DECLSPEC_ALIGN(64) struct {
BYTE m_padding1[64 - sizeof(LONG)];
// Only use with VolatileLoad+VolatileStore+FastInterlockCompareExchange
LONG m_numRequestsPending;
BYTE m_padding2[64];
};
};

Expand Down Expand Up @@ -283,17 +279,13 @@ class UnManagedPerAppDomainTPCount : public IPerAppDomainTPCount {
}

private:
struct {
SpinLock m_lock;
ULONG m_NumRequests;
};
struct {
DECLSPEC_ALIGN(64) struct {
BYTE padding1[64 - sizeof(LONG)];
// Only use with VolatileLoad+VolatileStore+FastInterlockCompareExchange
LONG m_outstandingThreadRequestCount;
BYTE padding2[64];
};
SpinLock m_lock;
ULONG m_NumRequests;
DECLSPEC_ALIGN(64) struct {
BYTE m_padding1[64 - sizeof(LONG)];
// Only use with VolatileLoad+VolatileStore+FastInterlockCompareExchange
LONG m_outstandingThreadRequestCount;
BYTE m_padding2[64];
};
};

Expand Down
6 changes: 2 additions & 4 deletions src/vm/win32threadpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4987,10 +4987,8 @@ DWORD __stdcall ThreadpoolMgr::TimerThreadStart(LPVOID p)
if (pThread == NULL)
return 0;

if (pTimerThread != pThread) {
pTimerThread = pThread;
// Timer threads never die
}
pTimerThread = pThread;
// Timer threads never die

LastTickCount = GetTickCount();

Expand Down
2 changes: 1 addition & 1 deletion src/vm/win32threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ class ThreadpoolMgr

Counts GetCleanCounts()
{
LIMITED_METHOD_CONTRACT;
#ifdef _WIN64
// VolatileLoad x64 bit read is atomic
return DangerousGetDirtyCounts();
#else // !_WIN64
// VolatileLoad may result in torn read
LIMITED_METHOD_CONTRACT;
Counts result;
#ifndef DACCESS_COMPILE
result.AsLongLong = FastInterlockCompareExchangeLong(&counts.AsLongLong, 0, 0);
Expand Down

0 comments on commit 2e0332a

Please sign in to comment.