~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_pthread.h

  • Committer: Andrew Hutchings
  • Date: 2010-11-01 22:04:06 UTC
  • mfrom: (1897 merge)
  • mto: This revision was merged to the branch mainline in revision 1907.
  • Revision ID: andrew@linuxjedi.co.uk-20101101220406-nj6i29uzja17u1hn
Merge trunk into branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include <unistd.h>
22
22
 
23
 
#include <boost/date_time.hpp>
24
 
 
25
23
#ifndef ETIME
26
24
#define ETIME ETIMEDOUT                         /* For FreeBSD */
27
25
#endif
72
70
#ifndef set_timespec_nsec
73
71
#define set_timespec_nsec(ABSTIME,NSEC) \
74
72
{\
75
 
  boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());\
76
 
  boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));\
77
 
  uint64_t t_mark= (mytime-epoch).total_microseconds();\
78
 
  uint64_t now= t_mark + (NSEC/100); \
 
73
  uint64_t now= my_getsystime() + (NSEC/100); \
79
74
  (ABSTIME).tv_sec=  (time_t) (now / 10000000UL);                  \
80
75
  (ABSTIME).tv_nsec= (long) (now % 10000000UL * 100 + ((NSEC) % 100)); \
81
76
}