Exemple #1
0
        public static SafeTaskHandle FileWrite(
            dsn_handle_t hFile,
            byte[] buffer,
            int count,
            ulong offset,
            TaskCode callbackCode,
            Clientlet callbackOwner,
            AioHandler callback,
            int hash = 0
            )
        {
            var idx  = GlobalInterOpLookupTable.Put(callback);
            var task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash, callbackOwner?.tracker() ?? IntPtr.Zero);

            Native.dsn_file_write(hFile, buffer, count, offset, task);
            return(new SafeTaskHandle(task, idx));
        }
Exemple #2
0
        public static dsn_task_t FileWrite(
            dsn_handle_t hFile,
            byte[] buffer,
            int count,
            UInt64 offset,
            TaskCode callbackCode,
            Servicelet callbackOwner,
            AioHandler callback,
            int hash = 0
            )
        {
            int        idx  = GlobalInterOpLookupTable.Put(callback);
            dsn_task_t task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash);

            Native.dsn_file_write(hFile, buffer, count, offset, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero);
            return(task);
        }
 public extern static void         dsn_semaphore_signal(dsn_handle_t s, int count);
 public extern static void         dsn_rwlock_nr_unlock_write(dsn_handle_t l);
 public extern static void         dsn_rwlock_nr_destroy(dsn_handle_t l);
 public extern static bool         dsn_exlock_try_lock(dsn_handle_t l);
Exemple #7
0
 public static extern void         dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
Exemple #8
0
 public static extern bool         dsn_semaphore_wait_timeout(dsn_handle_t s, int timeout_milliseconds);
Exemple #9
0
 public static ErrorCode FileClose(dsn_handle_t file)
 {
     var err = Native.dsn_file_close(file);
     return new ErrorCode(err);
 }
Exemple #10
0
 public extern static void         dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb, dsn_task_tracker_t tracker);
Exemple #11
0
 public extern static void         dsn_rwlock_nr_lock_write(dsn_handle_t l);
Exemple #12
0
 public extern static void         dsn_rwlock_nr_lock_read(dsn_handle_t l);
Exemple #13
0
 public extern static void         dsn_exlock_lock(dsn_handle_t l);
Exemple #14
0
 public static extern void         dsn_file_read(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
Exemple #15
0
 public static extern void         dsn_rwlock_nr_lock_write(dsn_handle_t l);
 public extern static bool         dsn_semaphore_wait_timeout(dsn_handle_t s, int timeout_milliseconds);
 public extern static void         dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
Exemple #18
0
        public static ErrorCode FileClose(dsn_handle_t file)
        {
            int err = Native.dsn_file_close(file);

            return(new ErrorCode(err));
        }
Exemple #19
0
 public static extern void         dsn_rwlock_nr_lock_read(dsn_handle_t l);
Exemple #20
0
 public static extern void         dsn_exlock_destroy(dsn_handle_t l);
Exemple #21
0
 public static extern dsn_error_t  dsn_file_close(dsn_handle_t file);
Exemple #22
0
 public static extern bool         dsn_exlock_try_lock(dsn_handle_t l);
 public extern static void         dsn_exlock_destroy(dsn_handle_t l);
Exemple #24
0
 public static extern void         dsn_exlock_unlock(dsn_handle_t l);
 public extern static void         dsn_exlock_unlock(dsn_handle_t l);
Exemple #26
0
 public static extern void         dsn_rwlock_nr_destroy(dsn_handle_t l);
 public extern static void         dsn_rwlock_nr_unlock_read(dsn_handle_t l);
Exemple #28
0
 public static extern void         dsn_rwlock_nr_unlock_read(dsn_handle_t l);
 public extern static void         dsn_semaphore_destroy(dsn_handle_t s);
Exemple #30
0
 public static extern void         dsn_rwlock_nr_unlock_write(dsn_handle_t l);
 public extern static void         dsn_semaphore_wait(dsn_handle_t s);
Exemple #32
0
 public static extern void         dsn_semaphore_destroy(dsn_handle_t s);
 public extern static dsn_error_t  dsn_file_close(dsn_handle_t file);
Exemple #34
0
 public static extern void         dsn_semaphore_signal(dsn_handle_t s, int count);
 public static SafeTaskHandle FileRead(
     dsn_handle_t hFile,
     byte[] buffer,
     int count,
     UInt64 offset,
     TaskCode callbackCode,
     Clientlet callbackOwner,
     AioHandler callback,
     int hash = 0
     )
 {
     int idx = GlobalInterOpLookupTable.Put(callback);
     dsn_task_t task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero);
     Native.dsn_file_read(hFile, buffer, count, offset, task);
     return new SafeTaskHandle(task, idx);
 }
Exemple #36
0
 public static extern void         dsn_semaphore_wait(dsn_handle_t s);
Exemple #37
0
 public static SafeTaskHandle FileWrite(
     dsn_handle_t hFile,
     byte[] buffer,
     int count,
     ulong offset,
     TaskCode callbackCode,
     Clientlet callbackOwner,
     AioHandler callback,
     int hash = 0
     )
 {
     var idx = GlobalInterOpLookupTable.Put(callback);
     var task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash, callbackOwner?.tracker() ?? IntPtr.Zero);
     Native.dsn_file_write(hFile, buffer, count, offset, task);
     return new SafeTaskHandle(task, idx);
 }
Exemple #38
0
 public static extern void         dsn_exlock_lock(dsn_handle_t l);