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

Method do_readonly_stuff

dlib/test/read_write_mutex.cpp:90–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 void do_readonly_stuff()
91 {
92 mut.lock();
93 ++num_read;
94 max_read = max(num_read, max_read);
95 mut.unlock();
96
97 if (num_write != 0)
98 {
99 failure = true;
100 dlog << LERROR << "3";
101 }
102
103 dlib::sleep(300);
104
105 if (num_write != 0)
106 {
107 failure = true;
108 dlog << LERROR << "4";
109 }
110
111 mut.lock();
112 max_read = max(num_read, max_read);
113 --num_read;
114 mut.unlock();
115
116 print_spinner();
117 }
118
119 void thread_readonly ()
120 {

Callers

nothing calls this directly

Calls 5

print_spinnerFunction · 0.85
maxFunction · 0.50
sleepFunction · 0.50
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected