classes/phing/system/io/FileSystem.php
public function lock(PhingFile $f)
    {
        $filename = $f->getPath();
        $fp = @fopen($filename, "w");
        $result = @flock($fp, LOCK_EX);
        @fclose($fp);
        if (!$result) {
            throw new IOException("Could not lock file '$filename'");
        }
    }
public function lock(PhingFile $f)
    {
        $filename = $f->getPath();
        $fp = @fopen($filename, "w");
        $result = @flock($fp, LOCK_EX);
        @fclose($fp);
        if (!$result) {
            throw new IOException("Could not lock file '$filename'");
        }
    }
public function lock ( PhingFile $ f ) { $ filename = $ f -> getPath ( ) ; $ fp = @ fopen ( $ filename , "w" ) ; $ result = @ flock ( $ fp , LOCK_EX ) ; @ fclose ( $ fp ) ; if ( ! $ result ) { throw new IOException ( "Could not lock file '$filename'" ) ; } }
Locks a file and throws an Exception if this is not possible.

@param  PhingFile $f
@return void
@throws IOException
Locks a file and throws an Exception if this is not possible .