diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-10-18 11:23:13 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-10-18 11:28:08 -0400 |
commit | 0594aa1636ef960361cf60d00c58ab94c81ee5d4 (patch) | |
tree | 4901787972b19b88aeac4b286985fe02dc5a9013 /libnautilus-private/nautilus-file-operations.c | |
parent | 04975e6cbc8f82238e3611a26b474b56c46ec1d3 (diff) | |
download | nautilus-0594aa1636ef960361cf60d00c58ab94c81ee5d4.tar.gz |
all: don't use deprecated GMutex/GThread API
Also, threads area always enabled, so we can remove the
G_THREADS_ENABLED conditionals.
Require GLib 2.31 for this.
Diffstat (limited to 'libnautilus-private/nautilus-file-operations.c')
-rw-r--r-- | libnautilus-private/nautilus-file-operations.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index c47553ca3..ba64b3d78 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -173,8 +173,7 @@ typedef struct { } TransferInfo; #define SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE 15 -#define NSEC_PER_SEC 1000000000 -#define NSEC_PER_MSEC 1000000 +#define NSEC_PER_MICROSEC 1000 #define MAXIMUM_DISPLAYED_FILE_NAME_LENGTH 50 @@ -1393,12 +1392,12 @@ report_delete_progress (CommonJob *job, int files_left; double elapsed, transfer_rate; int remaining_time; - guint64 now; + gint64 now; char *files_left_s; - now = g_thread_gettime (); + now = g_get_monotonic_time (); if (transfer_info->last_report_time != 0 && - ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MSEC) { + ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MICROSEC) { return; } transfer_info->last_report_time = now; @@ -2844,10 +2843,10 @@ report_copy_progress (CopyMoveJob *copy_job, is_move = copy_job->is_move; - now = g_thread_gettime (); - + now = g_get_monotonic_time (); + if (transfer_info->last_report_time != 0 && - ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MSEC) { + ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MICROSEC) { return; } transfer_info->last_report_time = now; |