Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
f39c73c7
Commit
f39c73c7
authored
Oct 20, 2015
by
Robin Appelman
Committed by
Thomas Müller
Oct 21, 2015
Browse files
Options
Downloads
Patches
Plain Diff
add phpdoc
parent
cc7bd53d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/lock/abstractlockingprovider.php
+7
-0
7 additions, 0 deletions
lib/private/lock/abstractlockingprovider.php
lib/private/lock/dblockingprovider.php
+6
-0
6 additions, 0 deletions
lib/private/lock/dblockingprovider.php
with
13 additions
and
0 deletions
lib/private/lock/abstractlockingprovider.php
+
7
−
0
View file @
f39c73c7
...
@@ -33,6 +33,13 @@ abstract class AbstractLockingProvider implements ILockingProvider {
...
@@ -33,6 +33,13 @@ abstract class AbstractLockingProvider implements ILockingProvider {
'exclusive'
=>
[]
'exclusive'
=>
[]
];
];
/**
* Check if we've locally acquired a lock
*
* @param string $path
* @param int $type
* @return bool
*/
protected
function
hasAcquiredLock
(
$path
,
$type
)
{
protected
function
hasAcquiredLock
(
$path
,
$type
)
{
if
(
$type
===
self
::
LOCK_SHARED
)
{
if
(
$type
===
self
::
LOCK_SHARED
)
{
return
isset
(
$this
->
acquiredLocks
[
'shared'
][
$path
])
&&
$this
->
acquiredLocks
[
'shared'
][
$path
]
>
0
;
return
isset
(
$this
->
acquiredLocks
[
'shared'
][
$path
])
&&
$this
->
acquiredLocks
[
'shared'
][
$path
]
>
0
;
...
...
This diff is collapsed.
Click to expand it.
lib/private/lock/dblockingprovider.php
+
6
−
0
View file @
f39c73c7
...
@@ -51,6 +51,12 @@ class DBLockingProvider extends AbstractLockingProvider {
...
@@ -51,6 +51,12 @@ class DBLockingProvider extends AbstractLockingProvider {
const
TTL
=
3600
;
// how long until we clear stray locks in seconds
const
TTL
=
3600
;
// how long until we clear stray locks in seconds
/**
* Check if we have an open shared lock for a path
*
* @param string $path
* @return bool
*/
protected
function
isLocallyLocked
(
$path
)
{
protected
function
isLocallyLocked
(
$path
)
{
return
isset
(
$this
->
sharedLocks
[
$path
])
&&
$this
->
sharedLocks
[
$path
];
return
isset
(
$this
->
sharedLocks
[
$path
])
&&
$this
->
sharedLocks
[
$path
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment