projects
/
debian
/
gnuradio
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'v3.3.0' into upstream
[debian/gnuradio]
/
gnuradio-core
/
src
/
lib
/
io
/
gr_file_sink_base.cc
diff --git
a/gnuradio-core/src/lib/io/gr_file_sink_base.cc
b/gnuradio-core/src/lib/io/gr_file_sink_base.cc
index 29ac0dbb1dcb978dd1b433d12efa94ad822eab6f..5ddeeb4d5686fffc8aadfc0ca1e725ce95d03ffb 100644
(file)
--- a/
gnuradio-core/src/lib/io/gr_file_sink_base.cc
+++ b/
gnuradio-core/src/lib/io/gr_file_sink_base.cc
@@
-1,6
+1,6
@@
/* -*- c++ -*- */
/*
/* -*- c++ -*- */
/*
- * Copyright 2004,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007
,2009
Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
*
* This file is part of GNU Radio
*
@@
-31,6
+31,7
@@
#include <fcntl.h>
#include <stdexcept>
#include <stdio.h>
#include <fcntl.h>
#include <stdexcept>
#include <stdio.h>
+#include <gruel/thread.h>
// win32 (mingw/msvc) specific
#ifdef HAVE_IO_H
// win32 (mingw/msvc) specific
#ifdef HAVE_IO_H
@@
-68,7
+69,7
@@
gr_file_sink_base::~gr_file_sink_base ()
bool
gr_file_sink_base::open(const char *filename)
{
bool
gr_file_sink_base::open(const char *filename)
{
-
omni_mutex_lock l(d_mutex);
// hold mutex for duration of this function
+
gruel::scoped_lock guard(d_mutex);
// hold mutex for duration of this function
// we use the open system call to get access to the O_LARGEFILE flag.
int fd;
// we use the open system call to get access to the O_LARGEFILE flag.
int fd;
@@
-96,7
+97,7
@@
gr_file_sink_base::open(const char *filename)
void
gr_file_sink_base::close()
{
void
gr_file_sink_base::close()
{
-
omni_mutex_lock l(d_mutex);
// hold mutex for duration of this function
+
gruel::scoped_lock guard(d_mutex);
// hold mutex for duration of this function
if (d_new_fp){
fclose(d_new_fp);
if (d_new_fp){
fclose(d_new_fp);
@@
-109,7
+110,7
@@
void
gr_file_sink_base::do_update()
{
if (d_updated){
gr_file_sink_base::do_update()
{
if (d_updated){
-
omni_mutex_lock l(d_mutex);
// hold mutex for duration of this block
+
gruel::scoped_lock guard(d_mutex);
// hold mutex for duration of this block
if (d_fp)
fclose(d_fp);
d_fp = d_new_fp; // install new file pointer
if (d_fp)
fclose(d_fp);
d_fp = d_new_fp; // install new file pointer