Release of flock in case of errors?

后端 未结 2 1403
-上瘾入骨i
-上瘾入骨i 2020-12-18 21:50

Imagine the following Perl code (here in pseudo code):

successfully acquired flock for FILEHANDLER       # line 1
some error or maybe simply a call to exit()         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 22:29

    When the program exits, the OS automatically releases all locks acquired by the program and closes all files opened by the program.

提交回复
热议问题