X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/fna.git/blobdiff_plain/ff14c3a38ad29e8617c11fc8f3868cc144eee318..134806f7924a468e3ebef661f39ae7bc50aa4ad3:/src_frescan/frescan_bwres_robjs.c diff --git a/src_frescan/frescan_bwres_robjs.c b/src_frescan/frescan_bwres_robjs.c index d2784da..cdf2915 100644 --- a/src_frescan/frescan_bwres_robjs.c +++ b/src_frescan/frescan_bwres_robjs.c @@ -93,7 +93,7 @@ struct replyobj_t { fosa_mutex_t mutex; }; -static struct replyobj_t the_reply_objects[FRESCAN_MX_REPLY_OBJECTS]; +static struct replyobj_t the_reply_objects[FRESCAN_BWRES_MX_REPLY_OBJECTS]; static freelist_t freelist; /** @@ -112,7 +112,7 @@ int frescan_bwres_robjs_init(int max_ceiling) err = fosa_mutex_init(&freelist_mutex, max_ceiling); if (err != 0) return err; - err = freelist_init(&freelist, FRESCAN_MX_REPLY_OBJECTS); + err = freelist_init(&freelist, FRESCAN_BWRES_MX_REPLY_OBJECTS); if (err != 0) return err; is_initialized = true; @@ -128,11 +128,11 @@ int frescan_bwres_robjs_init(int max_ceiling) * **/ -int frescan_bwres_robjs_alloc(frescan_robj_id_t *id, int ceiling) +int frescan_bwres_robjs_alloc(frescan_bwres_robj_id_t *id, int ceiling) { int err, pos; - DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG, + DEBUG(FRESCAN_BWRES_ROBJS_ENABLE_DEBUG, "allocating reply object, is_initialized=%d\n", is_initialized); if (is_initialized == false) return -1; @@ -155,7 +155,7 @@ int frescan_bwres_robjs_alloc(frescan_robj_id_t *id, int ceiling) err = fosa_mutex_init(&the_reply_objects[pos].mutex, ceiling); if (err != 0) return err; - DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG, + DEBUG(FRESCAN_BWRES_ROBJS_ENABLE_DEBUG, "reply object allocated, id=%d\n", *id); return 0; @@ -172,11 +172,11 @@ locked_error: * **/ -int frescan_bwres_robjs_free(frescan_robj_id_t id) +int frescan_bwres_robjs_free(frescan_bwres_robj_id_t id) { int err; - DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG, + DEBUG(FRESCAN_BWRES_ROBJS_ENABLE_DEBUG, "free reply id=%d, is_initialized=%d\n", id, is_initialized); if (is_initialized == false) return -1; @@ -212,22 +212,22 @@ locked_error: * **/ -int frescan_bwres_robjs_signal(frescan_robj_id_t id) +int frescan_bwres_robjs_signal(frescan_bwres_robj_id_t id) { int err; - DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG, + DEBUG(FRESCAN_BWRES_ROBJS_ENABLE_DEBUG, "is_initialized=%d\n", is_initialized); if (is_initialized == false) return -1; - DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG, + DEBUG(FRESCAN_BWRES_ROBJS_ENABLE_DEBUG, "taking mutex of the reply id=%d\n", id); err = fosa_mutex_lock(&the_reply_objects[id].mutex); if (err != 0) return err; the_reply_objects[id].is_work_done = true; - DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG, + DEBUG(FRESCAN_BWRES_ROBJS_ENABLE_DEBUG, "signal the cond variable\n"); err = fosa_cond_signal(&the_reply_objects[id].cond); if (err != 0) goto locked_error; @@ -250,7 +250,7 @@ locked_error: * **/ -int frescan_bwres_robjs_wait(frescan_robj_id_t id) +int frescan_bwres_robjs_wait(frescan_bwres_robj_id_t id) { int err; @@ -284,7 +284,7 @@ locked_error: * **/ -int frescan_bwres_robjs_timedwait(frescan_robj_id_t id, +int frescan_bwres_robjs_timedwait(frescan_bwres_robj_id_t id, const struct timespec *abstime) { int err;