Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
f72b31aa
Commit
f72b31aa
authored
Oct 25, 2001
by
Leigh B. Stoller
Browse files
Add experiment lock/unlock (expt_locked) routines.
parent
88b42cc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/libdb.pm.in
View file @
f72b31aa
...
...
@@ -70,7 +70,7 @@ use Exporter;
DBQuoteSpecial
UNIX2DBUID
ExpState
SetExpState
ProjLeader
ExpNodes
DBDateTime
DefaultImageID
GroupLeader
TBGroupUnixInfo
TBValidNodeLogType
TBValidNodeName
TBSetNodeLogEntry
TBSetSchedReload
MapNodeOSID
TBSetSchedReload
MapNodeOSID
TBLockExp
TBUnLockExp
);
#
Must
come
after
package
declaration
!
...
...
@@ -749,6 +749,50 @@ sub SetExpState($$$)
return
1
;
}
#
#
Lock
Experiment
.
#
#
usage
:
TBLockExp
(
char
*
pid
,
char
*
eid
)
#
returns
1
if
okay
.
#
returns
0
if
an
invalid
pid
/
eid
or
if
an
error
.
#
sub
TBLockExp
($$)
{
my
($
pid
,
$
eid
)
=
@
_
;
my
$
query_result
=
DBQueryWarn
(
"update experiments set expt_locked=now() "
.
"where eid='$eid' and pid='$pid'"
);
if
(
! $query_result ||
$
query_result
->
numrows
==
0
)
{
return
0
;
}
return
1
;
}
#
#
UnLock
Experiment
.
#
#
usage
:
TBUnLockExp
(
char
*
pid
,
char
*
eid
)
#
returns
1
if
okay
.
#
returns
0
if
an
invalid
pid
/
eid
or
if
an
error
.
#
sub
TBUnLockExp
($$)
{
my
($
pid
,
$
eid
)
=
@
_
;
my
$
query_result
=
DBQueryWarn
(
"update experiments set expt_locked=NULL "
.
"where eid='$eid' and pid='$pid'"
);
if
(
! $query_result ||
$
query_result
->
numrows
==
0
)
{
return
0
;
}
return
1
;
}
#
#
Return
BatchMode
state
.
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment