Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/smbd/process_thread.c

    r414 r745  
    3030#include "system/wait.h"
    3131#include "system/filesys.h"
     32#include "system/time.h"
    3233#include "lib/events/events.h"
    3334#include "lib/util/dlinklist.h"
     
    6364*/
    6465static void thread_accept_connection(struct tevent_context *ev,
    65                                      struct loadparm_context *lp_ctx, 
     66                                     struct loadparm_context *lp_ctx,
    6667                                     struct socket_context *sock,
    6768                                     void (*new_conn)(struct tevent_context *,
     
    133134        struct new_task_state *new_task = talloc_get_type(thread_parm, struct new_task_state);
    134135
    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(),
    136137                           new_task->private_data);
    137138
     
    189190
    190191/* called when a task goes down */
    191 static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason) 
     192static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason)
    192193{
    193194        DEBUG(10,("thread_terminate: reason[%s]\n",reason));
     
    234235}
    235236
    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);
     237static void mutex_start_timer(struct timespec *tp1)
     238{
     239        clock_gettime_mono(tp1);
     240}
     241
     242static double mutex_end_timer(struct timespec tp1)
     243{
     244        struct timespec tp2;
     245
     246        clock_gettime_mono(&tp2);
    245247        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);
    247249}
    248250
     
    255257        int rc;
    256258        double t;
    257         struct timeval tp1;
     259        struct timespec tp1;
    258260        /* Test below is ONLY for debugging */
    259261        if ((rc = pthread_mutex_trylock(mutex))) {
     
    317319        int rc;
    318320        double t;
    319         struct timeval tp1;
     321        struct timespec tp1;
    320322        /* Test below is ONLY for debugging */
    321323        if ((rc = pthread_rwlock_tryrdlock(rwlock))) {
     
    346348        int rc;
    347349        double t;
    348         struct timeval tp1;
     350        struct timespec tp1;
    349351        /* Test below is ONLY for debugging */
    350352        if ((rc = pthread_rwlock_trywrlock(rwlock))) {
     
    460462{
    461463#ifdef SIGSEGV
    462         CatchSignal(SIGSEGV,SIGNAL_CAST thread_sig_fault);
     464        CatchSignal(SIGSEGV, thread_sig_fault);
    463465#endif
    464466#ifdef SIGBUS
    465         CatchSignal(SIGBUS,SIGNAL_CAST thread_sig_fault);
     467        CatchSignal(SIGBUS, thread_sig_fault);
    466468#endif
    467469#ifdef SIGABRT
    468         CatchSignal(SIGABRT,SIGNAL_CAST thread_sig_fault);
     470        CatchSignal(SIGABRT, thread_sig_fault);
    469471#endif
    470472}
     
    510512  called when the process model is selected
    511513*/
    512 static void thread_model_init(struct tevent_context *event_context)
     514static void thread_model_init(void)
    513515{
    514516        struct mutex_ops m_ops;
     
    519521
    520522        pthread_key_create(&title_key, NULL);
    521         pthread_setspecific(title_key, talloc_strdup(event_context, ""));
     523        pthread_setspecific(title_key, NULL);
    522524
    523525        /* register mutex/rwlock handlers */
Note: See TracChangeset for help on using the changeset viewer.