projects
/
OpenSPARC-T2-DV
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV]
/
tools
/
src
/
nas,5.n2.os.2
/
lib
/
python
/
lib
/
python2.4
/
lib-old
/
lockfile.py
import
struct
,
fcntl
def
writelock
(
f
):
_lock
(
f
,
fcntl
.
F_WRLCK
)
def
readlock
(
f
):
_lock
(
f
,
fcntl
.
F_RDLCK
)
def
unlock
(
f
):
_lock
(
f
,
fcntl
.
F_UNLCK
)
def
_lock
(
f
,
op
):
dummy
=
fcntl
.
fcntl
(
f
.
fileno
(),
fcntl
.
F_SETLKW
,
struct
.
pack
(
'2h8l'
,
op
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
))