Changeset 0543f16 in rtems-libbsd


Ignore:
Timestamp:
Jan 23, 2014, 2:28:23 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, c1e05b9ea378b2971e3d7704779112b4bc4296da, freebsd-9.3, 4a77611a223ea883fb548679b516d326a020d447
Children:
bc78466
Parents:
f7205c1
git-author:
Sebastian Huber <sebastian.huber@…> (01/23/14 14:28:23)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/30/14 15:23:05)
Message:

mDNS: Use mutex for mDNSPosix platform

Location:
mDNSResponder/mDNSPosix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mDNSResponder/mDNSPosix/mDNSPosix.c

    rf7205c1 r0543f16  
    12211221    int err = 0;
    12221222    struct sockaddr sa;
     1223#ifdef __rtems__
     1224    pthread_mutexattr_t attr;
     1225#endif /* __rtems__ */
    12231226    assert(m != NULL);
    12241227
     
    12381241
    12391242    mDNS_SetFQDN(m);
     1243#ifdef __rtems__
     1244    if (err == mStatus_NoError) err = pthread_mutexattr_init(&attr);
     1245    if (err == mStatus_NoError) err = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
     1246    if (err == mStatus_NoError) err = pthread_mutex_init(&m->p->mutex, &attr);
     1247    if (err == mStatus_NoError) err = pthread_mutexattr_destroy(&attr);
     1248#endif /* __rtems__ */
    12401249
    12411250    sa.sa_family = AF_INET;
     
    13071316mDNSexport void    mDNSPlatformLock   (const mDNS *const m)
    13081317{
     1318#ifndef __rtems__
    13091319    (void) m;   // Unused
     1320#else /* __rtems__ */
     1321    pthread_mutex_lock(&m->p->mutex);
     1322#endif /* __rtems__ */
    13101323}
    13111324
     
    13141327mDNSexport void    mDNSPlatformUnlock (const mDNS *const m)
    13151328{
     1329#ifndef __rtems__
    13161330    (void) m;   // Unused
     1331#else /* __rtems__ */
     1332    pthread_mutex_unlock(&m->p->mutex);
     1333#endif /* __rtems__ */
    13171334}
    13181335
  • mDNSResponder/mDNSPosix/mDNSPosix.h

    rf7205c1 r0543f16  
    2121#include <signal.h>
    2222#include <sys/time.h>
     23#ifdef __rtems__
     24#include <pthread.h>
     25#endif /* __rtems__ */
    2326
    2427#ifdef  __cplusplus
     
    5558    int unicastSocket6;
    5659#endif
     60#ifdef __rtems__
     61    pthread_mutex_t mutex;
     62#endif /* __rtems__ */
    5763};
    5864
Note: See TracChangeset for help on using the changeset viewer.