Commit f72b7f1c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 19eaac56
......@@ -59,8 +59,13 @@ cdef class PyWatchLink:
cdef WatchLink *wlink
def __xinit__(PyWatchLink pywlink, PyWCFS pywc):
_ = wcfs_openwatch_pyexc(pywc.wc)
# XXX
with nogil:
_ = wcfs_openwatch_pyexc(pywc.wc)
pywlink.wlink = _.first
err = _.second
if err != nil:
raise RuntimeError(err.Error()) # XXX exc class?
def close(PyWatchLink pywlink):
with nogil:
......
......@@ -28,6 +28,9 @@ using std::string;
#include <tuple>
using std::tuple;
#include <utility>
using std::pair;
#include "wcfs_misc.h"
struct Conn;
......@@ -42,7 +45,7 @@ struct WCFS {
tuple<Conn*, error> connect(zodb::Tid at);
string _path(const string &obj);
tuple<os::File, error> _open(const string &path, int flags=O_RDONLY);
tuple<WatchLink*, error> _openwatch();
pair<WatchLink*, error> _openwatch();
};
......
......@@ -38,6 +38,10 @@ using namespace golang;
#include <string>
using std::string;
#include <utility>
using std::pair;
using std::make_pair;
#include <tuple>
using std::tuple;
using std::make_tuple;
......
......@@ -25,7 +25,7 @@
// _openwatch opens new watch link on wcfs.
tuple<WatchLink*, error> WCFS::_openwatch() {
pair<WatchLink*, error> WCFS::_openwatch() {
WCFS *wc = this;
// head/watch handle.
......@@ -33,7 +33,7 @@ tuple<WatchLink*, error> WCFS::_openwatch() {
error err;
tie(f, err) = wc->_open("head/watch", O_RDWR);
if (err != nil)
return make_tuple((WatchLink *)NULL, err);
return make_pair((WatchLink *)NULL, err);
WatchLink *wlink = new(WatchLink);
wlink->_wc = wc;
......@@ -49,7 +49,7 @@ tuple<WatchLink*, error> WCFS::_openwatch() {
wlink->_serveWG.go(wlink._serveRX)
#endif
return make_tuple(wlink, nil);
return make_pair(wlink, nil);
}
void WatchLink::_closeTX() {
......
......@@ -85,7 +85,7 @@ class WatchLink {
#endif
public:
friend tuple<WatchLink*, error> WCFS::_openwatch();
friend pair<WatchLink*, error> WCFS::_openwatch();
error close();
error recvReq(context::Context *ctx, PinReq *rx_into);
tuple<string, error> sendReq(context::Context *ctx, const string &req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment