| 5679 | } |
| 5680 | |
| 5681 | static int rand(void) |
| 5682 | { |
| 5683 | uint32_t x, y; |
| 5684 | do |
| 5685 | { |
| 5686 | x = rand_state; |
| 5687 | y = (1103515245 * x + 12345) & 0x7FFFFFFF; |
| 5688 | } |
| 5689 | while (!__sync_bool_compare_and_swap(&rand_state, x, y)); |
| 5690 | return (y >> 16); |
| 5691 | } |
| 5692 | |
| 5693 | /****************************************************************************/ |
| 5694 | /* SOCKET */ |
no outgoing calls