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
a3b3ca7c
Commit
a3b3ca7c
authored
Oct 13, 2016
by
antirez
Browse files
Modules: use RedisModule_AbortBlock() in the example.
parent
95c17c0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/modules/helloblock.c
View file @
a3b3ca7c
...
@@ -99,7 +99,7 @@ int HelloBlock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int a
...
@@ -99,7 +99,7 @@ int HelloBlock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int a
targ
[
1
]
=
(
void
*
)(
unsigned
long
)
delay
;
targ
[
1
]
=
(
void
*
)(
unsigned
long
)
delay
;
if
(
pthread_create
(
&
tid
,
NULL
,
HelloBlock_ThreadMain
,
targ
)
!=
0
)
{
if
(
pthread_create
(
&
tid
,
NULL
,
HelloBlock_ThreadMain
,
targ
)
!=
0
)
{
/*
RedisModule_
BlockedClient
Abort(bc);
*/
RedisModule_Abort
Block
(
bc
);
return
RedisModule_ReplyWithError
(
ctx
,
"-ERR Can't start thread"
);
return
RedisModule_ReplyWithError
(
ctx
,
"-ERR Can't start thread"
);
}
}
return
REDISMODULE_OK
;
return
REDISMODULE_OK
;
...
...
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