小编pal*_*rom的帖子

会不会违反互斥锁?

我做错了,是吗?

...
if( you_think_youre_genius )
    goto goto_sucks:
...
pthread_mutex_lock(&mutex);

    do_stuff();

    goto_sucks:
        do_other_stuff();

pthread_mutex_unlock(&mutex);
Run Code Online (Sandbox Code Playgroud)

c mutex goto

7
推荐指数
2
解决办法
264
查看次数

addBatch()和executeBatch()线程安全吗?

我可以从一个线程调用executeBacth而另一个继续在同一个Statement(或PreparedStatement)对象上调用addBatch()吗?

更新:有没有人对此问题有所了解?因为我的结果不正确.并非所有添加到批处理中的更新都会执行.

java jdbc thread-safety

5
推荐指数
2
解决办法
4514
查看次数

标签 统计

c ×1

goto ×1

java ×1

jdbc ×1

mutex ×1

thread-safety ×1