Some changes to the interface (added missing methods and such). Implemented the class almost completely. Basically only the notification stuff is still missing.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4126 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#ifndef _K_DISK_DEVICE_JOB_QUEUE_H
|
||||
#define _K_DISK_DEVICE_JOB_QUEUE_H
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include "disk_device_manager.h"
|
||||
|
||||
namespace BPrivate {
|
||||
@@ -16,19 +18,49 @@ public:
|
||||
KDiskDeviceJobQueue();
|
||||
~KDiskDeviceJobQueue();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
void SetDevice(KDiskDevice *device);
|
||||
KDiskDevice *Device() const;
|
||||
|
||||
KDiskDeviceJob *ActiveJob() const; // is not in list of scheduled jobs
|
||||
KDiskDeviceJob *ActiveJob() const;
|
||||
|
||||
// list of scheduled jobs
|
||||
bool AddJob(KDiskDeviceJob *job);
|
||||
KDiskDeviceJob *RemoveJob(int32 index);
|
||||
bool RemoveJob(KDiskDeviceJob *job);
|
||||
// Adding/removing is only possible before the queues is added to the
|
||||
// manager.
|
||||
KDiskDeviceJob *JobAt(int32 index) const;
|
||||
int32 CountJobs() const;
|
||||
|
||||
void Execute();
|
||||
status_t Execute();
|
||||
// Called by the manager, when the queue is added to it.
|
||||
// manager must be locked
|
||||
status_t Cancel(bool reverse);
|
||||
status_t Pause();
|
||||
status_t Continue();
|
||||
sem_id ReadyToPause();
|
||||
// called only by the queue's thread from within a module hook
|
||||
|
||||
bool IsExecuting() const;
|
||||
bool IsCanceled() const;
|
||||
bool ShallReverse() const;
|
||||
bool IsPaused() const;
|
||||
bool IsPauseRequested() const;
|
||||
|
||||
private:
|
||||
struct JobQueue;
|
||||
|
||||
int32 _ThreadLoop();
|
||||
static int32 _ThreadEntry(void *data);
|
||||
|
||||
KDiskDevice *fDevice;
|
||||
int32 fActiveJob;
|
||||
JobQueue *fJobs;
|
||||
uint32 fFlags;
|
||||
thread_id fThread;
|
||||
sem_id fSyncSemaphore;
|
||||
};
|
||||
|
||||
} // namespace DiskDevice
|
||||
|
||||
Reference in New Issue
Block a user