class MyMutex
{
volatile long bLocked;
public:
MyMutex(const char* name, nvtxDomainHandle_t d){
bLocked = 0;
nvtxSyncUserAttributes_t attribs = { 0 };
attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
attribs.message.ascii = name;
}
~MyMutex() {
}
bool Lock() {
bool acquired = __sync_bool_compare_and_swap(&bLocked, 0, 1);
if (acquired) {
}
else {
}
return acquired;
}
void Unlock() {
bLocked = false;
}
};
@ NVTX_MESSAGE_TYPE_ASCII
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireStart(nvtxSyncUser_t handle)
Signal to tools that an attempt to acquire a user defined synchronization object.
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireFailed(nvtxSyncUser_t handle)
Signal to tools of failure in acquiring a user defined synchronization object This should be called a...
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserReleasing(nvtxSyncUser_t handle)
Signal to tools of releasing a reservation on user defined synchronization object This should be call...
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireSuccess(nvtxSyncUser_t handle)
Signal to tools of success in acquiring a user defined synchronization object This should be called a...
struct nvtxSyncUser * nvtxSyncUser_t
User Defined Synchronization Object Handle . .
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserDestroy(nvtxSyncUser_t handle)
Destroy a user defined synchronization object This is used to track non-OS synchronization working wi...
NVTX_DECLSPEC nvtxSyncUser_t NVTX_API nvtxDomainSyncUserCreate(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t *attribs)
Create a user defined synchronization object This is used to track non-OS synchronization working wit...