Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
スレッドでファイルを開き、pthread_exit() ルーチンを使用してスレッドを終了しました。開いているファイルも閉じますか?
いいえpthread_exit()、開いているファイルは閉じません。
pthread_exit()
スレッド固有のリソースのみを解放します。ファイル記述子はプロセス全体であり、スレッドで開いたファイルは開いたままになりpthread_exit()、ファイルを閉じる前に呼び出すとリソース リークが発生します。