forked from lix-project/lix
c8d3882cdc
parallel as possible (similar to GNU Make's `-j' switch). This is useful on SMP systems, but it is especially useful for doing builds on multiple machines. The idea is that a large derivation is initiated on one master machine, which then distributes sub-derivations to any number of slave machines. This should not happen synchronously or in lock-step, so the master must be capable of dealing with multiple parallel build jobs. We now have the infrastructure to support this. TODO: substitutes are currently broken.
29 lines
458 B
C++
29 lines
458 B
C++
#ifndef __PATHLOCKS_H
|
|
#define __PATHLOCKS_H
|
|
|
|
#include "util.hh"
|
|
|
|
|
|
typedef enum LockType { ltRead, ltWrite, ltNone };
|
|
|
|
bool lockFile(int fd, LockType lockType, bool wait);
|
|
|
|
|
|
class PathLocks
|
|
{
|
|
private:
|
|
list<int> fds;
|
|
Paths paths;
|
|
bool deletePaths;
|
|
|
|
public:
|
|
PathLocks();
|
|
PathLocks(const PathSet & paths);
|
|
void lockPaths(const PathSet & _paths);
|
|
~PathLocks();
|
|
void setDeletion(bool deletePaths);
|
|
};
|
|
|
|
|
|
#endif /* !__PATHLOCKS_H */
|