opt msg on mnode
This commit is contained in:
parent
2537adb728
commit
3f0236ec17
|
@ -47,28 +47,29 @@ static void *dmStatusThreadFp(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SDmNotifyHandle dmNotifyHdl = {.state = 0};
|
SDmNotifyHandle dmNotifyHdl = {.state = 0};
|
||||||
static void *dmNotifyThreadFp(void *param) {
|
|
||||||
SDnodeMgmt *pMgmt = param;
|
|
||||||
setThreadName("dnode-notify");
|
|
||||||
|
|
||||||
if (tsem_init(&dmNotifyHdl.sem, 0, 0) != 0) {
|
static void *dmNotifyThreadFp(void *param) {
|
||||||
return NULL;
|
SDnodeMgmt *pMgmt = param;
|
||||||
|
setThreadName("dnode-notify");
|
||||||
|
|
||||||
|
if (tsem_init(&dmNotifyHdl.sem, 0, 0) != 0) {
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wait = true;
|
bool wait = true;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
if (pMgmt->pData->dropped || pMgmt->pData->stopped) break;
|
||||||
if (wait) tsem_wait(&dmNotifyHdl.sem);
|
if (wait) tsem_wait(&dmNotifyHdl.sem);
|
||||||
atomic_store_8(&dmNotifyHdl.state, 1);
|
atomic_store_8(&dmNotifyHdl.state, 1);
|
||||||
dmSendNotifyReq(pMgmt);
|
dmSendNotifyReq(pMgmt);
|
||||||
if (1 == atomic_val_compare_exchange_8(&dmNotifyHdl.state, 1, 0)) {
|
if (1 == atomic_val_compare_exchange_8(&dmNotifyHdl.state, 1, 0)) {
|
||||||
wait = true;
|
wait = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
wait = false;
|
wait = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *dmMonitorThreadFp(void *param) {
|
static void *dmMonitorThreadFp(void *param) {
|
||||||
|
|
Loading…
Reference in New Issue