File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ namespace mongo {
5353        }
5454    }
5555
56-     MSGID NextMsgId;
56+     AtomicWord< MSGID>  NextMsgId;
5757
5858    /* struct MsgStart {
5959        MsgStart() { 
@@ -63,8 +63,7 @@ namespace mongo {
6363    } msgstart;*/  
6464
6565    MSGID nextMessageId () {
66-         MSGID msgid = NextMsgId++;
67-         return  msgid;
66+         return  NextMsgId.fetchAndAdd (1 );
6867    }
6968
7069    bool  doesOpGetAResponse ( int  op ) {
Original file line number Diff line number Diff line change 3131
3232#include  < vector> 
3333
34- #include  " mongo/bson/util/atomic_int.h" 
34+ #include  " mongo/platform/atomic_word.h" 
35+ #include  " mongo/platform/cstdint.h" 
3536#include  " mongo/util/goodies.h" 
3637#include  " mongo/util/net/hostandport.h" 
3738#include  " mongo/util/net/sock.h" 
@@ -47,7 +48,7 @@ namespace mongo {
4748    class  MessagingPort ;
4849    class  PiggyBackData ;
4950
50-     typedef  AtomicUInt  MSGID;
51+     typedef  uint32_t  MSGID;
5152
5253    enum  Operations {
5354        opReply = 1 ,     /*  reply. responseTo is set. */ 
Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ namespace mongo {
3939    class  MessagingPort ;
4040    class  PiggyBackData ;
4141
42-     typedef  AtomicUInt MSGID;
43- 
4442    class  AbstractMessagingPort  : boost::noncopyable {
4543    public: 
4644        AbstractMessagingPort () : tag(0 ), _connectionId(0 ) {}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments