MCPcopy Create free account
hub / github.com/davisking/dlib / main

Function main

examples/multithreaded_object_ex.cpp:109–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107};
108
109int main()
110{
111 // tell the logger to output all messages
112 dlog.set_level(LALL);
113
114 // Create an instance of our multi-threaded object.
115 my_object t;
116
117 dlib::sleep(3000);
118
119 // Tell the multi-threaded object to pause its threads. This causes the
120 // threads to block on their next calls to should_stop().
121 t.pause();
122 dlog << LINFO << "paused threads";
123
124 dlib::sleep(3000);
125 dlog << LINFO << "starting threads back up from paused state";
126
127 // Tell the threads to unpause themselves. This causes should_stop() to unblock
128 // and to let the threads continue.
129 t.start();
130
131 dlib::sleep(3000);
132
133 // Let the program end. When t is destructed it will gracefully terminate your
134 // threads because we have set the destructor up to do so.
135}
136
137
138

Callers

nothing calls this directly

Calls 2

set_levelMethod · 0.80
sleepFunction · 0.50

Tested by

no test coverage detected