浏览代码

more portable way to write a bogus pthread_t

Samuel Thibault 8 年之前
父节点
当前提交
4b6405da7d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/core/sched_ctx.h

+ 1 - 1
src/core/sched_ctx.h

@@ -257,7 +257,7 @@ static inline void _starpu_sched_ctx_unlock_write(unsigned sched_ctx_id)
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 	STARPU_ASSERT(starpu_pthread_equal(sched_ctx->lock_write_owner, starpu_pthread_self()));
-	sched_ctx->lock_write_owner = 0;
+	memset(&sched_ctx->lock_write_owner, 0, sizeof(sched_ctx->lock_write_owner));
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&sched_ctx->rwlock);
 }