// SCE CONFIDENTIAL
// PLAYSTATION(R)3 Programmer Tool Runtime Library 250.001
// Copyright (C) 2008 Sony Computer Entertainment Inc.
// All Rights Reserved.

#ifndef __CELL_UTIL_SPURS_JOB_GUARD_H__
#define __CELL_UTIL_SPURS_JOB_GUARD_H__ 1

#include <cellUtilSpursDefine.h>
#include <cell/spurs/job_guard.h>

__CELL_UTIL_SPURS_BEGIN

class JobChain;

class JobGuard : public CellSpursJobGuard {
	JobGuard(const JobGuard&);
	JobGuard& operator =(const JobGuard&);

public:
	static const uint32_t ALIGN = CELL_SPURS_JOB_GUARD_ALIGN;
	JobGuard() {}

	static int initialize(JobGuard *guard,
						  const JobChain* jobChain,
						  uint32_t notifyCount,
						  uint8_t numReadyCount = 8,
						  uint8_t autoReset = 1)
		{
			return cellSpursJobGuardInitialize(
				reinterpret_cast<const CellSpursJobChain*>(jobChain),
				guard, notifyCount, numReadyCount, autoReset);
		}

	int notify(void)
		{
			return cellSpursJobGuardNotify(this);
		}
	int reset(void)
		{
			return cellSpursJobGuardReset(this);
		}

} __attribute__((aligned(CELL_SPURS_JOB_GUARD_ALIGN)));

__CELL_UTIL_SPURS_END

#endif // __CELL_UTIL_SPURS_JOB_GUARD_H__

// Local Variables:
// mode: C++
// c-file-style: "stroustrup"
// tab-width: 4
// End:
// vim:sw=4:sts=4:ts=4
