celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Broekhuis <abroekh...@apache.org>
Subject Re: svn commit: r1644361 - in /celix/trunk: log_service/private/src/log.c remote_services/discovery/private/src/endpoint_discovery_poller.c
Date Wed, 10 Dec 2014 10:05:11 GMT
@Bjoern: I've changed the thread initialisation to NULL, but apparently
this is not portable (likewise -1 is not portable as well). As far as I can
tell there is no portable way to do this, but on the other hand, since a
pthread_t is not supposed to be directly compared or whatever, it can be
debated that initialisation is not needed..

What do you think?

2014-12-10 10:59 GMT+01:00 <abroekhuis@apache.org>:

> Author: abroekhuis
> Date: Wed Dec 10 09:59:15 2014
> New Revision: 1644361
>
> URL: http://svn.apache.org/r1644361
> Log:
> CELIX-119: Fixed compiler issues and warnings.
>
> Modified:
>     celix/trunk/log_service/private/src/log.c
>
> celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c
>
> Modified: celix/trunk/log_service/private/src/log.c
> URL:
> http://svn.apache.org/viewvc/celix/trunk/log_service/private/src/log.c?rev=1644361&r1=1644360&r2=1644361&view=diff
>
> ==============================================================================
> --- celix/trunk/log_service/private/src/log.c (original)
> +++ celix/trunk/log_service/private/src/log.c Wed Dec 10 09:59:15 2014
> @@ -62,7 +62,7 @@ celix_status_t log_create(log_pt *logger
>
>                 (*logger)->listeners = NULL;
>                 (*logger)->listenerEntries = NULL;
> -               (*logger)->listenerThread = -1;
> +               (*logger)->listenerThread = NULL;
>                 (*logger)->running = false;
>
>                 arrayList_create(&(*logger)->listeners);
> @@ -211,7 +211,6 @@ celix_status_t log_addLogListener(log_pt
>
>  celix_status_t log_removeLogListener(log_pt logger, log_listener_pt
> listener) {
>         celix_status_t status = CELIX_SUCCESS;
> -    celix_status_t threadStatus = CELIX_SUCCESS;
>         bool last = false;
>
>      status = CELIX_DO_IF(status,
> celixThreadMutex_lock(&logger->deliverLock));
> @@ -228,11 +227,11 @@ celix_status_t log_removeLogListener(log
>          status = CELIX_DO_IF(status,
> celixThreadMutex_unlock(&logger->deliverLock));
>
>                 if (last) {
> -                   status = CELIX_DO_IF(status,
> celixThread_join(logger->listenerThread, &threadStatus));
> +                   status = CELIX_DO_IF(status,
> celixThread_join(logger->listenerThread, NULL));
>                 }
>
>                 if (status == CELIX_SUCCESS) {
> -                       logger->listenerThread = -1;
> +                       logger->listenerThread = NULL;
>                 }
>         }
>
> @@ -329,6 +328,6 @@ static void * log_listenerThread(void *d
>
>         }
>
> -    celixThread_exit(status);
> +    celixThread_exit(NULL);
>      return NULL;
>  }
>
> Modified:
> celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c
> URL:
> http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c?rev=1644361&r1=1644360&r2=1644361&view=diff
>
> ==============================================================================
> ---
> celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c
> (original)
> +++
> celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c
> Wed Dec 10 09:59:15 2014
> @@ -190,7 +190,7 @@ celix_status_t endpointDiscoveryPoller_r
>          return CELIX_BUNDLE_EXCEPTION;
>      }
>
> -    hash_map_entry_pt endpointEntry =
> hashMap_removeEntryForKey(poller->entries, url);
> +    hash_map_entry_pt endpointEntry = hashMap_remove(poller->entries,
> url);
>
>      free(hashMapEntry_getKey(endpointEntry));
>      array_list_pt entries = hashMapEntry_getValue(endpointEntry);
>
>
>


-- 
With kind regards,

Alexander Broekhuis

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message