Changeset 745 for trunk/server/source4/smbd/process_thread.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/smbd/process_thread.c
r414 r745 30 30 #include "system/wait.h" 31 31 #include "system/filesys.h" 32 #include "system/time.h" 32 33 #include "lib/events/events.h" 33 34 #include "lib/util/dlinklist.h" … … 63 64 */ 64 65 static void thread_accept_connection(struct tevent_context *ev, 65 struct loadparm_context *lp_ctx, 66 struct loadparm_context *lp_ctx, 66 67 struct socket_context *sock, 67 68 void (*new_conn)(struct tevent_context *, … … 133 134 struct new_task_state *new_task = talloc_get_type(thread_parm, struct new_task_state); 134 135 135 new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(), 136 new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(), 136 137 new_task->private_data); 137 138 … … 189 190 190 191 /* called when a task goes down */ 191 static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason) 192 static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason) 192 193 { 193 194 DEBUG(10,("thread_terminate: reason[%s]\n",reason)); … … 234 235 } 235 236 236 static void mutex_start_timer(struct timeval *tp1) 237 { 238 gettimeofday(tp1,NULL); 239 } 240 241 static double mutex_end_timer(struct timeval tp1) 242 { 243 struct timeval tp2; 244 gettimeofday(&tp2,NULL); 237 static void mutex_start_timer(struct timespec *tp1) 238 { 239 clock_gettime_mono(tp1); 240 } 241 242 static double mutex_end_timer(struct timespec tp1) 243 { 244 struct timespec tp2; 245 246 clock_gettime_mono(&tp2); 245 247 return((tp2.tv_sec - tp1.tv_sec) + 246 (tp2.tv_ usec - tp1.tv_usec)*1.0e-6);248 (tp2.tv_nsec - tp1.tv_nsec)*1.0e-9); 247 249 } 248 250 … … 255 257 int rc; 256 258 double t; 257 struct time valtp1;259 struct timespec tp1; 258 260 /* Test below is ONLY for debugging */ 259 261 if ((rc = pthread_mutex_trylock(mutex))) { … … 317 319 int rc; 318 320 double t; 319 struct time valtp1;321 struct timespec tp1; 320 322 /* Test below is ONLY for debugging */ 321 323 if ((rc = pthread_rwlock_tryrdlock(rwlock))) { … … 346 348 int rc; 347 349 double t; 348 struct time valtp1;350 struct timespec tp1; 349 351 /* Test below is ONLY for debugging */ 350 352 if ((rc = pthread_rwlock_trywrlock(rwlock))) { … … 460 462 { 461 463 #ifdef SIGSEGV 462 CatchSignal(SIGSEGV, SIGNAL_CASTthread_sig_fault);464 CatchSignal(SIGSEGV, thread_sig_fault); 463 465 #endif 464 466 #ifdef SIGBUS 465 CatchSignal(SIGBUS, SIGNAL_CASTthread_sig_fault);467 CatchSignal(SIGBUS, thread_sig_fault); 466 468 #endif 467 469 #ifdef SIGABRT 468 CatchSignal(SIGABRT, SIGNAL_CASTthread_sig_fault);470 CatchSignal(SIGABRT, thread_sig_fault); 469 471 #endif 470 472 } … … 510 512 called when the process model is selected 511 513 */ 512 static void thread_model_init( struct tevent_context *event_context)514 static void thread_model_init(void) 513 515 { 514 516 struct mutex_ops m_ops; … … 519 521 520 522 pthread_key_create(&title_key, NULL); 521 pthread_setspecific(title_key, talloc_strdup(event_context, ""));523 pthread_setspecific(title_key, NULL); 522 524 523 525 /* register mutex/rwlock handlers */
Note:
See TracChangeset
for help on using the changeset viewer.