| 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); |
no test coverage detected