/[rdesktop]/sourceforge.net/trunk/rdesktop/scard.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/scard.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1327 by stargo, Fri Nov 3 19:56:42 2006 UTC revision 1328 by stargo, Fri Nov 3 23:51:35 2006 UTC
# Line 44  Line 44 
44    
45  static struct stream out[STREAM_COUNT];  static struct stream out[STREAM_COUNT];
46  static int cur_stream_id = 0;  static int cur_stream_id = 0;
47  static pthread_mutex_t *tcp_sendcontrol_mutex = NULL;  static pthread_mutex_t **scard_mutex = NULL;
 static pthread_mutex_t *sec_channels_mutex = NULL;  
48    
49  static uint32 curDevice = 0, curId = 0, curBytesOut = 0;  static uint32 curDevice = 0, curId = 0, curBytesOut = 0;
50  static PSCNameMapRec nameMapList = NULL;  static PSCNameMapRec nameMapList = NULL;
# Line 2620  DEVICE_FNS scard_fns = { Line 2619  DEVICE_FNS scard_fns = {
2619  #endif /* MAKE_PROTO */  #endif /* MAKE_PROTO */
2620    
2621  void  void
2622  scard_tcp_lock(void)  scard_lock(int lock)
2623  {  {
2624          if (!tcp_sendcontrol_mutex)          if (!scard_mutex)
2625          {          {
2626                  tcp_sendcontrol_mutex = (pthread_mutex_t *) xmalloc(sizeof(pthread_mutex_t));                  scard_mutex =
2627                  pthread_mutex_init(tcp_sendcontrol_mutex, NULL);                          (pthread_mutex_t **) xmalloc(sizeof(pthread_mutex_t *) * SCARD_LOCK_LAST);
2628          }          }
2629    
2630          pthread_mutex_lock(tcp_sendcontrol_mutex);          if (!scard_mutex[lock])
 }  
   
 void  
 scard_tcp_unlock(void)  
 {  
         pthread_mutex_unlock(tcp_sendcontrol_mutex);  
 }  
   
 void  
 scard_sec_lock(void)  
 {  
         if (!sec_channels_mutex)  
2631          {          {
2632                  sec_channels_mutex = (pthread_mutex_t *) xmalloc(sizeof(pthread_mutex_t));                  scard_mutex[lock] = (pthread_mutex_t *) xmalloc(sizeof(pthread_mutex_t));
2633                  pthread_mutex_init(sec_channels_mutex, NULL);                  pthread_mutex_init(scard_mutex[lock], NULL);
2634          }          }
2635    
2636          pthread_mutex_lock(sec_channels_mutex);          pthread_mutex_lock(scard_mutex[lock]);
2637  }  }
2638    
2639  void  void
2640  scard_sec_unlock(void)  scard_unlock(int lock)
2641  {  {
2642          pthread_mutex_unlock(sec_channels_mutex);          pthread_mutex_unlock(scard_mutex[lock]);
2643  }  }
2644    
2645  STREAM  STREAM

Legend:
Removed from v.1327  
changed lines
  Added in v.1328

  ViewVC Help
Powered by ViewVC 1.1.26