MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / timer_create

Function timer_create

src/plugin/timer/timerwrappers.cpp:28–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26using namespace dmtcp;
27
28extern "C" int
29timer_create(clockid_t clockid, struct sigevent *sevp, timer_t *timerid)
30{
31 struct sigevent sevOut;
32 timer_t realId;
33 timer_t virtId;
34 int ret;
35
36 DMTCP_PLUGIN_DISABLE_CKPT();
37
38 // Note that clockid can be for a system-wide clock with no virtual id.
39 // An example is CLOCK_REALTIME. By luck, VIRTUAL_TO_REAL_CLOCK_ID()
40 // return its argument if no virtual id is found.
41 // See: virtualidtable.h: dmtcp::VirtualIdTable::virtualToReal(...)
42 clockid_t realClockId = VIRTUAL_TO_REAL_CLOCK_ID(clockid);
43 if (sevp != NULL && sevp->sigev_notify == SIGEV_THREAD) {
44 ret = timer_create_sigev_thread(realClockId, sevp, &realId, &sevOut);
45 sevp = &sevOut;
46 } else {
47 ret = _real_timer_create(realClockId, sevp, &realId);
48 }
49 if (ret != -1 && timerid != NULL) {
50 virtId = TimerList::instance().on_timer_create(realId, clockid, sevp);
51 JTRACE("Creating new timer") (clockid) (realClockId) (realId) (virtId);
52 *timerid = virtId;
53 }
54 DMTCP_PLUGIN_ENABLE_CKPT();
55 return ret;
56}
57
58extern "C" int
59timer_delete(timer_t timerid)

Callers 3

make_timerFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls 3

_real_timer_createFunction · 0.85
on_timer_createMethod · 0.80

Tested by

no test coverage detected