MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / _acquire

Method _acquire

tools/filelock.py:351–365  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

349 """
350
351 def _acquire(self):
352 open_mode = os.O_RDWR | os.O_CREAT | os.O_TRUNC
353
354 try:
355 fd = os.open(self._lock_file, open_mode)
356 except OSError:
357 pass
358 else:
359 try:
360 msvcrt.locking(fd, msvcrt.LK_NBLCK, 1)
361 except (IOError, OSError):
362 os.close(fd)
363 else:
364 self._lock_file_fd = fd
365 return None
366
367 def _release(self):
368 fd = self._lock_file_fd

Callers

nothing calls this directly

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected