public function __construct($name, \PDO $pdo)
{
if (strlen($name) > 128) {
throw new \LengthException("The name should not be longer than 128 characters.");
}
if ($pdo->getAttribute(\PDO::ATTR_ERRMODE) !== \PDO::ERRMODE_EXCEPTION) {
throw new \InvalidArgumentException("The pdo must have PDO::ERRMODE_EXCEPTION set.");
}
$this->pdo = $pdo;
$this->name = $name;
$this->mutex = new TransactionalMutex($pdo);
}