-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
1,081 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
TCL_VERSIONS="8.5 8.6" | ||
TCLSH="" | ||
|
||
for VERSION in $TCL_VERSIONS; do | ||
TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL | ||
done | ||
|
||
if [ -z $TCLSH ] | ||
then | ||
echo "You need tcl 8.5 or newer in order to run the Redis test" | ||
exit 1 | ||
fi | ||
|
||
make -C tests/modules && \ | ||
$TCLSH tests/test_helper.tcl --single unit/moduleapi/commandfilter "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#pragma once | ||
|
||
class AeLocker | ||
{ | ||
bool m_fArmed = false; | ||
|
||
public: | ||
AeLocker() | ||
{ | ||
} | ||
|
||
void arm(client *c) // if a client is passed, then the client is already locked | ||
{ | ||
if (c != nullptr) | ||
{ | ||
serverAssert(!m_fArmed); | ||
serverAssert(c->lock.fOwnLock()); | ||
|
||
if (!aeTryAcquireLock(true /*fWeak*/)) // avoid locking the client if we can | ||
{ | ||
bool fOwnClientLock = true; | ||
int clientNesting = 1; | ||
for (;;) | ||
{ | ||
if (fOwnClientLock) | ||
{ | ||
clientNesting = c->lock.unlock_recursive(); | ||
fOwnClientLock = false; | ||
} | ||
aeAcquireLock(); | ||
if (!c->lock.try_lock(false)) // ensure a strong try because aeAcquireLock is expensive | ||
{ | ||
aeReleaseLock(); | ||
} | ||
else | ||
{ | ||
break; | ||
} | ||
} | ||
c->lock.lock_recursive(clientNesting); | ||
} | ||
|
||
m_fArmed = true; | ||
} | ||
else if (!m_fArmed) | ||
{ | ||
m_fArmed = true; | ||
aeAcquireLock(); | ||
} | ||
} | ||
|
||
void disarm() | ||
{ | ||
serverAssert(m_fArmed); | ||
m_fArmed = false; | ||
aeReleaseLock(); | ||
} | ||
|
||
bool isArmed() const | ||
{ | ||
return m_fArmed; | ||
} | ||
|
||
~AeLocker() | ||
{ | ||
if (m_fArmed) | ||
aeReleaseLock(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.