| | 250 | |
| | 251 | /* |
| | 252 | * Pulls a suffix buffer from the freelist, if one is available. |
| | 253 | */ |
| | 254 | char *mt_suffix_from_freelist() { |
| | 255 | char *s; |
| | 256 | |
| | 257 | pthread_mutex_lock(&suffix_lock); |
| | 258 | s = do_suffix_from_freelist(); |
| | 259 | pthread_mutex_unlock(&suffix_lock); |
| | 260 | |
| | 261 | return s; |
| | 262 | } |
| | 263 | |
| | 264 | |
| | 265 | /* |
| | 266 | * Adds a suffix buffer to the freelist. |
| | 267 | * |
| | 268 | * Returns 0 on success, 1 if the buffer couldn't be added. |
| | 269 | */ |
| | 270 | bool mt_suffix_add_to_freelist(char *s) { |
| | 271 | bool result; |
| | 272 | |
| | 273 | pthread_mutex_lock(&conn_lock); |
| | 274 | result = do_conn_add_to_freelist(s); |
| | 275 | pthread_mutex_unlock(&conn_lock); |
| | 276 | |
| | 277 | return result; |
| | 278 | } |
| | 279 | |