Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
b04a5df9
Commit
b04a5df9
authored
Jan 15, 2010
by
antirez
Browse files
A define to make Redis more helgrind friendly
parent
1064ef87
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
b04a5df9
...
@@ -75,6 +75,11 @@
...
@@ -75,6 +75,11 @@
#include "lzf.h"
/* LZF compression library */
#include "lzf.h"
/* LZF compression library */
#include "pqsort.h"
/* Partial qsort for SORT+LIMIT */
#include "pqsort.h"
/* Partial qsort for SORT+LIMIT */
/* #define REDIS_HELGRIND_FRIENDLY */
#if defined(__GNUC__) && defined(REDIS_HELGRIND_FRIENDLY)
#warning "Remember to undef REDIS_HELGRIND_FRIENDLY before to commit"
#endif
/* Error codes */
/* Error codes */
#define REDIS_OK 0
#define REDIS_OK 0
#define REDIS_ERR -1
#define REDIS_ERR -1
...
@@ -7664,6 +7669,15 @@ static void *IOThreadEntryPoint(void *arg) {
...
@@ -7664,6 +7669,15 @@ static void *IOThreadEntryPoint(void *arg) {
/* Get a new job to process */
/* Get a new job to process */
lockThreadedIO
();
lockThreadedIO
();
if
(
listLength
(
server
.
io_newjobs
)
==
0
)
{
if
(
listLength
(
server
.
io_newjobs
)
==
0
)
{
#ifdef REDIS_HELGRIND_FRIENDLY
/* No new jobs? Wait and retry, because to be Helgrind
* (valgrind --tool=helgrind) what's needed is to take
* the same threads running instead to create/destroy threads
* as needed (otherwise valgrind will fail) */
unlockThreadedIO
();
usleep
(
1
);
/* Give some time for the I/O thread to work. */
continue
;
#endif
/* No new jobs in queue, exit. */
/* No new jobs in queue, exit. */
redisLog
(
REDIS_DEBUG
,
"Thread %lld exiting, nothing to do"
,
redisLog
(
REDIS_DEBUG
,
"Thread %lld exiting, nothing to do"
,
(
long
long
)
pthread_self
());
(
long
long
)
pthread_self
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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