]> rtime.felk.cvut.cz Git - frescor/fna.git/blobdiff - src_frescan/frescan_bwres_robjs.c
changes to use the FRSH FSA module to do the analysis and spare capacity. TODO: finis...
[frescor/fna.git] / src_frescan / frescan_bwres_robjs.c
index 01e051b4c11d19a7b1bd13b95d055e7f6929cc9f..d2784da7577fddf825850969c884b31105180b55 100644 (file)
  *
  * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
  *
+ * @license
+ *
+ * -----------------------------------------------------------------------
+ *  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
+ *
+ *    Universidad de Cantabria,              SPAIN
+ *    University of York,                    UK
+ *    Scuola Superiore Sant'Anna,            ITALY
+ *    Kaiserslautern University,             GERMANY
+ *    Univ. Politécnica  Valencia,           SPAIN
+ *    Czech Technical University in Prague,  CZECH REPUBLIC
+ *    ENEA                                   SWEDEN
+ *    Thales Communication S.A.              FRANCE
+ *    Visual Tools S.A.                      SPAIN
+ *    Rapita Systems Ltd                     UK
+ *    Evidence                               ITALY
+ *
+ *    See http://www.frescor.org for a link to partners' websites
+ *
+ *           FRESCOR project (FP6/2005/IST/5-034026) is funded
+ *        in part by the European Union Sixth Framework Programme
+ *        The European Union is not liable of any use that may be
+ *        made of this code.
+ *
+ *  This file is part of FRESCAN
+ *
+ *  FRESCAN is free software; you can  redistribute it and/or  modify
+ *  it under the terms of  the GNU General Public License as published by
+ *  the Free Software Foundation;  either  version 2, or (at  your option)
+ *  any later version.
+ *
+ *  FRESCAN  is distributed  in  the hope  that  it  will  be useful,  but
+ *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
+ *  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
+ *  General Public License for more details.
+ *
+ *  You should have  received a  copy of  the  GNU  General Public License
+ *  distributed  with  FRESCAN;  see file COPYING.   If not,  write to the
+ *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
+ *  02111-1307, USA.
+ *
+ * As a special exception, including FRESCAN header files in a file,
+ * instantiating FRESCAN generics or templates, or linking other files
+ * with FRESCAN objects to produce an executable application, does not
+ * by itself cause the resulting executable application to be covered
+ * by the GNU General Public License. This exception does not
+ * however invalidate any other reasons why the executable file might be
+ * covered by the GNU Public License.
+ * -----------------------------------------------------------------------
+ *
  */
 
 #include <misc/freelist.h>
@@ -82,7 +132,7 @@ int frescan_bwres_robjs_alloc(frescan_robj_id_t *id, int ceiling)
 {
         int err, pos;
 
-        DEBUG(FRESCAN_REPLYOBJ_ENABLE_DEBUG,
+        DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG,
               "allocating reply object, is_initialized=%d\n", is_initialized);
 
         if (is_initialized == false) return -1;
@@ -105,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_REPLYOBJ_ENABLE_DEBUG,
+        DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG,
               "reply object allocated, id=%d\n", *id);
 
         return 0;
@@ -126,7 +176,7 @@ int frescan_bwres_robjs_free(frescan_robj_id_t id)
 {
         int err;
 
-        DEBUG(FRESCAN_REPLYOBJ_ENABLE_DEBUG,
+        DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG,
               "free reply id=%d, is_initialized=%d\n", id, is_initialized);
 
         if (is_initialized == false) return -1;
@@ -166,18 +216,18 @@ int frescan_bwres_robjs_signal(frescan_robj_id_t id)
 {
         int err;
 
-        DEBUG(FRESCAN_REPLYOBJ_ENABLE_DEBUG,
+        DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG,
               "is_initialized=%d\n", is_initialized);
         if (is_initialized == false) return -1;
 
-        DEBUG(FRESCAN_REPLYOBJ_ENABLE_DEBUG,
+        DEBUG(FRESCAN_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_REPLYOBJ_ENABLE_DEBUG,
+                DEBUG(FRESCAN_ROBJS_ENABLE_DEBUG,
                       "signal the cond variable\n");
                 err = fosa_cond_signal(&the_reply_objects[id].cond);
                 if (err != 0) goto locked_error;
@@ -188,7 +238,7 @@ int frescan_bwres_robjs_signal(frescan_robj_id_t id)
         return 0;
 
 locked_error:
-        ERROR("locked error %d\n", err);
+        FRESCAN_ERROR("locked error %d\n", err);
         fosa_mutex_unlock(&the_reply_objects[id].mutex);
         return err;
 }