[ https://issues.apache.org/jira/browse/WHIMSY-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061574#comment-16061574 ]
Sebb commented on WHIMSY-109: ----------------------------- Yes, I know the original working directory is restored at the end of the block. However whilst the block is active, AIUI the entire OS process working directory is changed. I don't know enough about how Ruby uses OS processes to know whether it's possible for a single process to have multiple code sections active at the same time. This is very common in Java, where all threads run in the same process. If this can happen in Ruby, then such code blocks can interfere with each other. I suppose the way OS processes are used may depend on the Ruby interpreter that is used? > Code uses Dir.chdir and Dir.pwd without sync > -------------------------------------------- > > Key: WHIMSY-109 > URL: https://issues.apache.org/jira/browse/WHIMSY-109 > Project: Whimsy > Issue Type: Bug > Reporter: Sebb > Assignee: Sebb > > The lib/whimsy code uses Dir.chdir in two places: > asf/git.rb and svn.rb > These are done under Mutex synchronisation. > However AFAICT they use different instances of the Mutex. > Also, there is an instance of Dir.pwd in the file asf/rack.rb > This does not use a Mutex at all. > So unless there is some other mutual exclusion occurring, there is a > potential for confusion over the actual working directory. -- This message was sent by Atlassian JIRA (v6.4.14#64029)