Skip to content

Commit 9651a1d

Browse files
committed
safer cast
1 parent c8e4330 commit 9651a1d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

9_async_work/async.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void AsyncWork(uv_work_t *req) {
2828
// Function to execute when the async work is complete
2929
// this function will be run inside the main event loop
3030
// so it is safe to use V8 again
31-
void AsyncAfter(uv_work_t *req) {
31+
void AsyncAfter(uv_work_t *req, int status) {
3232
HandleScope scope;
3333

3434
// fetch our data structure
@@ -76,10 +76,12 @@ Handle<Value> CalculateAsync(const Arguments& args) {
7676
// worker-thread is available to
7777
uv_queue_work(
7878
uv_default_loop(),
79-
req, // work token
80-
AsyncWork, // work function
81-
(uv_after_work_cb)AsyncAfter // function to run when complete
79+
req, // work token
80+
AsyncWork, // work function
81+
// function called when complete:
82+
static_cast<uv_after_work_cb>(AsyncAfter)
8283
);
8384

8485
return scope.Close(Undefined());
8586
}
87+

0 commit comments

Comments
 (0)