~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_pthread.h

  • Committer: lbieber
  • Date: 2010-10-05 21:14:30 UTC
  • mfrom: (1775.5.2 bug621331)
  • mto: This revision was merged to the branch mainline in revision 1814.
  • Revision ID: lbieber@orisndriz08-20101005211430-xmy19fcls25swctl
Merge Billy - fix bug 621331 - Replace use of stringstream with boost::lexical_cast

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
}