Fails to build on FreeBSD due to -Werror=thread-safety
Regressed by 0d5fe24c due to freebsd@49891e45d241. From error log:
In file included from src/util/half_float.c:30:
In file included from src/util/half_float.h:32:
In file included from src/util/u_cpu_detect.h:40:
In file included from src/util/u_thread.h:34:
In file included from include/c11/threads.h:66:
include/c11/threads_posix.h:143:10: error: calling function 'pthread_cond_timedwait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
rt = pthread_cond_timedwait(cond, mtx, abs_time);
^
include/c11/threads_posix.h:155:13: error: calling function 'pthread_cond_wait' requires holding mutex 'mtx' exclusively [-Werror,-Wthread-safety-analysis]
return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error;
^
include/c11/threads_posix.h:224:1: error: mutex 'mtx' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
include/c11/threads_posix.h:223:13: note: mutex acquired here
return (pthread_mutex_lock(mtx) == 0) ? thrd_success : thrd_error;
^
include/c11/threads_posix.h:259:1: error: mutex 'mtx' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
include/c11/threads_posix.h:242:10: note: mutex acquired here
rt = pthread_mutex_timedlock(mtx, ts);
^
include/c11/threads_posix.h:274:13: error: releasing mutex 'mtx' that was not held [-Werror,-Wthread-safety-analysis]
return (pthread_mutex_unlock(mtx) == 0) ? thrd_success : thrd_error;
^
Annotating c11/threads_posix.h
exposes more, so may need to disable like llvm@83dca5c3d1b2.
src/util/slab.c:266:31: error: mutex 'pool->parent->mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
owner_int = p_atomic_read(&elt->owner);
^
src/util/slab.c:261:7: note: mutex acquired here
mtx_lock(&pool->parent->mutex);
^
src/util/slab.c:273:10: error: releasing mutex 'pool->parent->mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&pool->parent->mutex);
^
src/util/slab.c:276:10: error: releasing mutex 'pool->parent->mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&pool->parent->mutex);
^
src/util/u_queue.c:497:8: error: mutex 'queue->finish_lock' is not held on every path through here [-Werror,-Wthread-safety-analysis]
if (keep_num_threads >= queue->num_threads) {
^
src/util/u_queue.c:495:7: note: mutex acquired here
mtx_lock(&queue->finish_lock);
^
src/util/u_queue.c:498:7: error: releasing mutex 'queue->finish_lock' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&queue->finish_lock);
^
src/util/u_queue.c:515:7: error: releasing mutex 'queue->finish_lock' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&queue->finish_lock);
^
src/vulkan/wsi/wsi_common_display.c:1264:10: error: calling function 'pthread_cond_timedwait' requires holding mutex 'wsi->wait_mutex' exclusively [-Werror,-Wthread-safety-analysis]
ret = pthread_cond_timedwait(&wsi->wait_cond, &wsi->wait_mutex,
^
In file included from src/mesa/swrast/s_texfilter.c:33:
src/mesa/main/texobj.h:107:4: error: mutex 'ctx->Shared->TexMutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
ctx->Shared->TextureStateStamp++;
^
src/mesa/main/texobj.h:106:7: note: mutex acquired here
mtx_lock(&ctx->Shared->TexMutex);
^
src/mesa/main/texobj.h:116:7: error: releasing mutex 'ctx->Shared->TexMutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&ctx->Shared->TexMutex);
^
In file included from src/mesa/drivers/common/driverfuncs.c:34:
In file included from src/mesa/main/queryobj.h:31:
src/mesa/main/hash.h:140:1: error: mutex 'table->Mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
src/mesa/main/hash.h:139:4: note: mutex acquired here
mtx_lock(&table->Mutex);
^
src/mesa/main/hash.h:152:4: error: releasing mutex 'table->Mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&table->Mutex);
^
In file included from src/mesa/drivers/common/driverfuncs.c:43:
src/mesa/main/texobj.h:107:4: error: mutex 'ctx->Shared->TexMutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
ctx->Shared->TextureStateStamp++;
^
src/mesa/main/texobj.h:106:7: note: mutex acquired here
mtx_lock(&ctx->Shared->TexMutex);
^
src/mesa/main/texobj.h:116:7: error: releasing mutex 'ctx->Shared->TexMutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&ctx->Shared->TexMutex);
^
src/intel/vulkan/anv_pipeline_cache.c:362:1: error: mutex 'cache->mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
src/intel/vulkan/anv_pipeline_cache.c:361:7: note: mutex acquired here
pthread_mutex_lock(&cache->mutex);
^
src/intel/vulkan/anv_pipeline_cache.c:368:7: error: releasing mutex 'cache->mutex' that was not held [-Werror,-Wthread-safety-analysis]
pthread_mutex_unlock(&cache->mutex);
^
src/intel/vulkan/anv_queue.c:2651:24: error: calling function 'pthread_cond_timedwait' requires holding mutex 'device->mutex' exclusively [-Werror,-Wthread-safety-analysis]
UNUSED int ret = pthread_cond_timedwait(&device->queue_submit,
^
src/intel/vulkan/anv_queue.c:2659:11: error: expecting mutex 'device->mutex' to be held at start of each loop [-Werror,-Wthread-safety-analysis]
while (1) {
^
src/intel/vulkan/anv_queue.c:2680:7: note: mutex acquired here
pthread_mutex_lock(&device->mutex);
^
src/intel/vulkan/anv_queue.c:2674:7: error: releasing mutex 'device->mutex' that was not held [-Werror,-Wthread-safety-analysis]
pthread_mutex_unlock(&device->mutex);
^
src/intel/vulkan/anv_queue.c:2687:1: error: mutex 'device->mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
src/intel/vulkan/anv_queue.c:2680:7: note: mutex acquired here
pthread_mutex_lock(&device->mutex);
^
In file included from src/mesa/state_tracker/st_cb_texture.c:48:
src/mesa/main/texobj.h:107:4: error: mutex 'ctx->Shared->TexMutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
ctx->Shared->TextureStateStamp++;
^
src/mesa/main/texobj.h:106:7: note: mutex acquired here
mtx_lock(&ctx->Shared->TexMutex);
^
src/mesa/main/texobj.h:116:7: error: releasing mutex 'ctx->Shared->TexMutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&ctx->Shared->TexMutex);
^
src/egl/main/eglapi.c:254:11: error: mutex 'disp->Mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
return disp;
^
src/egl/main/eglapi.c:253:7: note: mutex acquired here
mtx_lock(&disp->Mutex);
^
src/egl/main/eglapi.c:264:4: error: releasing mutex 'disp->Mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&disp->Mutex);
^
src/egl/main/eglapi.c:1519:1: error: mutex 'disp->Mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
src/egl/main/eglapi.c:1507:4: note: mutex acquired here
mtx_lock(&disp->Mutex);
^
src/egl/main/eglapi.c:1562:1: error: mutex 'disp->Mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
src/egl/main/eglapi.c:1550:4: note: mutex acquired here
mtx_lock(&disp->Mutex);
^
src/gallium/auxiliary/driver_trace/tr_dump.c:254:1: error: mutex 'call_mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
src/gallium/auxiliary/driver_trace/tr_dump.c:253:4: note: mutex acquired here
mtx_lock(&call_mutex);
^
src/gallium/auxiliary/driver_trace/tr_dump.c:258:4: error: releasing mutex 'call_mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&call_mutex);
^
src/gallium/auxiliary/driver_trace/tr_dump.c:348:1: error: mutex 'call_mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
src/gallium/auxiliary/driver_trace/tr_dump.c:346:4: note: mutex acquired here
mtx_lock(&call_mutex);
^
src/gallium/auxiliary/driver_trace/tr_dump.c:353:4: error: releasing mutex 'call_mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&call_mutex);
^
In file included from src/mesa/drivers/dri/i965/intel_tex_copy.c:30:
src/mesa/main/texobj.h:107:4: error: mutex 'ctx->Shared->TexMutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
ctx->Shared->TextureStateStamp++;
^
src/mesa/main/texobj.h:106:7: note: mutex acquired here
mtx_lock(&ctx->Shared->TexMutex);
^
src/mesa/main/texobj.h:116:7: error: releasing mutex 'ctx->Shared->TexMutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&ctx->Shared->TexMutex);
^
src/gallium/auxiliary/driver_rbug/rbug_context.c:111:7: error: calling function 'cnd_wait' requires holding mutex 'rb_pipe->draw_mutex' exclusively [-Werror,-Wthread-safety-analysis]
cnd_wait(&rb_pipe->draw_cond, &rb_pipe->draw_mutex);
^
src/loader/loader_dri3_helper.c:185:1: error: mutex 'blit_context.mtx' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
src/loader/loader_dri3_helper.c:170:4: note: mutex acquired here
mtx_lock(&blit_context.mtx);
^
src/loader/loader_dri3_helper.c:194:4: error: releasing mutex 'blit_context.mtx' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&blit_context.mtx);
^
src/loader/loader_dri3_helper.c:573:7: error: calling function 'cnd_wait' requires holding mutex 'draw->mtx' exclusively [-Werror,-Wthread-safety-analysis]
cnd_wait(&draw->event_cnd, &draw->mtx);
^
src/loader/loader_dri3_helper.c:581:7: error: releasing mutex 'draw->mtx' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&draw->mtx);
^
src/loader/loader_dri3_helper.c:595:1: error: mutex 'draw->mtx' is not held on every path through here [-Werror,-Wthread-safety-analysis]
}
^
src/loader/loader_dri3_helper.c:583:7: note: mutex acquired here
mtx_lock(&draw->mtx);
^
In file included from src/mesa/drivers/dri/i965/intel_pixel_bitmap.c:36:
src/mesa/main/texobj.h:107:4: error: mutex 'ctx->Shared->TexMutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
ctx->Shared->TextureStateStamp++;
^
src/mesa/main/texobj.h:106:7: note: mutex acquired here
mtx_lock(&ctx->Shared->TexMutex);
^
src/mesa/main/texobj.h:116:7: error: releasing mutex 'ctx->Shared->TexMutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&ctx->Shared->TexMutex);
^
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c:351:7: error: releasing mutex 'fenced_mgr->mutex' that was not held [-Werror,-Wthread-safety-analysis]
mtx_unlock(&fenced_mgr->mutex);
^
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c:382:11: error: mutex 'fenced_mgr->mutex' is not held on every path through here [-Werror,-Wthread-safety-analysis]
return ret;
^
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c:355:7: note: mutex acquired here
mtx_lock(&fenced_mgr->mutex);
^