Added missing synchronization when dispatching asynchronous calls. From Sergey Oboguev

This commit is contained in:
Mark Pizzolato 2012-04-04 11:08:56 -07:00
parent ab3af3062d
commit a14a1ab5cd

View file

@ -151,6 +151,7 @@ if ((!callback) || !ctx->asynch_io)
struct tape_context *ctx = \
(struct tape_context *)uptr->tape_ctx; \
\
pthread_mutex_lock (&ctx->io_lock); \
\
sim_debug (ctx->dbit, ctx->dptr, \
"sim_tape AIO_CALL(op=%d, unit=%d)\n", op, uptr-ctx->dptr->units);\
@ -168,6 +169,7 @@ if ((!callback) || !ctx->asynch_io)
ctx->objupdate = _obj; \
ctx->callback = _callback; \
pthread_cond_signal (&ctx->io_cond); \
pthread_mutex_unlock (&ctx->io_lock); \
} \
else \
if (_callback) \