Changeset 7314 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Apr 17, 2006, 1:19:20 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_buffer.cc
r6222 r7314 42 42 43 43 ShellBuffer* ShellBuffer::singletonRef = NULL; 44 SDL_mutex* ShellBuffer::bufferMutex = NULL; 44 45 45 46 /** … … 52 53 53 54 this->flush(); 55 56 if (ShellBuffer::bufferMutex != NULL) 57 SDL_DestroyMutex(ShellBuffer::bufferMutex); 58 ShellBuffer::bufferMutex = NULL; 54 59 55 60 ShellBuffer::singletonRef = NULL; … … 103 108 va_start(arguments, line); 104 109 110 if (ShellBuffer::bufferMutex == NULL) 111 ShellBuffer::bufferMutex = SDL_CreateMutex(); 112 113 SDL_mutexP(ShellBuffer::bufferMutex); 105 114 #if DEBUG < 3 106 115 if (ShellBuffer::singletonRef == NULL) 107 116 #endif 108 109 117 vprintf(line, arguments); 110 118 #if DEBUG < 3 … … 114 122 #endif 115 123 ShellBuffer::singletonRef->addBufferLine(line, arguments); 124 SDL_mutexV(ShellBuffer::bufferMutex); 116 125 return true; 117 126 } -
trunk/src/lib/shell/shell_buffer.h
r5784 r7314 10 10 #include <stdarg.h> 11 11 #include <list> 12 #include <SDL_thread.h> 12 13 13 14 #define SHELL_BUFFER_SIZE 16384 //!< The Size of the input-buffers (should be large enough to carry any kind of input) … … 60 61 61 62 unsigned long lineCount; //!< how many Lines have been written out so far. 63 64 static SDL_mutex* bufferMutex; //!< Only one thread may write into the ShellBuffer at a time. 62 65 }; 63 66
Note: See TracChangeset
for help on using the changeset viewer.