~ubuntu-branches/ubuntu/precise/pdnsd/precise

« back to all changes in this revision

Viewing changes to src/thread.h

  • Committer: Bazaar Package Importer
  • Author(s): Mahyuddin Susanto
  • Date: 2011-03-09 18:54:22 UTC
  • mfrom: (1.3.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110309185422-33hwmg565m18dpu4
Tags: 1.2.8-par-1
* New Maintainer. (Closes: #596302)
* New Upstream Releases. (Closes: #596302, LP: #712938)
* debian/patches/05_fix_spelling.patch: Fix spelling errors.
* debian/patches/04_ipv6_localhost.patch. Adding ipv6 in localhost.
  (Closes: #466332, #504211)
* debian/init.d:
  - Add init status. (Closes: #476538)
  - Don't says starting pdnsd if already started. (Closes: #487467)
* deban/changelog: Fix incorrect date in 1.2.7-par-1 (Closes: #527352)
* debian/control:
  - Add Vcs-Browser and Vcs-Git to alioth.
  - Bump Standards-Version to 3.9.1.
* debian/copyright: Updated as per DEP-5 specification.
* debian/pdnsd-recurse.conf:
  - Adding recurse mode. (Closes: #602262)
  - Fixing recursive neg section. (Closes: #519656)
* doc/pdnsd.conf.in: Separate ip address by new line. Thanks to
  Raphael Geissert. (Closes: #597734)
* perm_cache size set to default. (Closes: #602329)
  - doc/pdnsd.conf.in
  - debian/pdnsd.conf
  - debian/pdnsd-recurse.conf
  - debian/pdnsd-resolvconf.conf
* debian/002_NetMan_pdnsd: add compabilty with WiFi. 
  (Closes: #617373, LP: #452351)
* Ack'd NMU upload. (Closes: #548173)
* Update debconf Indonesian translations. (Closes: #610148)
* Switch to quilt system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 * are needed because the LinuxThreads implementation obviously has some
43
43
 * problems in signal handling, which makes the recommended solution (doing
44
44
 * sigwait() in one thread and blocking the signals in all threads) impossible.
45
 
 * So, for Linux, we have to install the fatal_sig handler. 
 
45
 * So, for Linux, we have to install the fatal_sig handler.
46
46
 * It seems to me that signal handlers in fact aren't shared between threads
47
47
 * under Linux. Also, sigwait() does not seem to work as indicated in the docs */
48
48
 
106
106
#endif
107
107
 
108
108
 
109
 
/* This is a thread-safe usleep(). 
 
109
/* This is a thread-safe usleep().
110
110
   Implementation of the BSD usleep function using nanosleep.
111
111
*/
112
112
inline static int usleep_r(unsigned long useconds)
 
113
  __attribute__((always_inline));
 
114
inline static int usleep_r(unsigned long useconds)
113
115
{
114
116
  struct timespec ts = { tv_sec: (useconds / 1000000),
115
117
                         tv_nsec: (useconds % 1000000) * 1000ul };
122
124
   but it suits our purposes.
123
125
*/
124
126
inline static int sleep_r (unsigned int seconds)
 
127
  __attribute__((always_inline));
 
128
inline static int sleep_r (unsigned int seconds)
125
129
{
126
130
  struct timespec ts = { tv_sec: seconds, tv_nsec: 0 };
127
131
 
128
132
  return nanosleep(&ts, NULL);
129
133
}
130
 
  
 
134
 
131
135
 
132
136
/* Used for creating detached threads */
133
137
extern pthread_attr_t attr_detached;