MCPcopy Create free account
hub / github.com/Singular/Singular / lock

Method lock

kernel/oswrapper/vspace.h:385–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383 vmem_free(_lock);
384 }
385 void lock() {
386 if (_owner == vmem.current_process) {
387 _locklevel++;
388 } else {
389 lock_file(vmem.fd, METABLOCK_SIZE + _lock);
390 _owner = vmem.current_process;
391 _locklevel = 1;
392 }
393 }
394 void unlock() {
395 if (--_locklevel == 0) {
396 assert(_owner == vmem.current_process);

Callers 8

_lock_bucketMethod · 0.45
enqueue_nowaitMethod · 0.45
dequeue_nowaitMethod · 0.45
start_waitMethod · 0.45
stop_waitMethod · 0.45
readMethod · 0.45
try_readMethod · 0.45
writeMethod · 0.45

Calls 1

lock_fileFunction · 0.85

Tested by

no test coverage detected