这是代码:
unsigned int number;
FILE* urandom = fopen("/dev/urandom", "r");
if (urandom) {
size_t bytes_read = fread(&number, 1, sizeof(number), urandom);
DCHECK(bytes_read == sizeof(number));
fclose(urandom);
} else {
NOTREACHED();
}
如果不是,我如何使它成为线程安全的?