Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
[patch] change save index logic (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
  • Loading branch information
Yusuke Kato authored Apr 24, 2019
1 parent add7bd9 commit 2f725a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
NAME := gongt
VERSION := v0.0.2
VERSION := v1.1.1
GO_VERSION := $(shell go version)
REVISION := $(shell git rev-parse --short HEAD)
PROJECT_ROOT := $(shell pwd)

deps:
curl -LO https://github.com/yahoojapan/NGT/archive/v$(NGT_VERSION).tar.gz
tar zxf v$(NGT_VERSION).tar.gz -C /tmp
cd /tmp/NGT-$(NGT_VERSION); cmake .
cd /tmp/NGT-$(NGT_VERSION)&& cmake .
make -j -C /tmp/NGT-$(NGT_VERSION)
make install -C /tmp/NGT-$(NGT_VERSION)

Expand Down
4 changes: 2 additions & 2 deletions gongt.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,9 @@ func (n *NGT) SaveIndex() error {
ebuf := C.ngt_create_error_object()
defer C.ngt_destroy_error_object(ebuf)

n.mu.Lock()
n.mu.RLock()
ret := C.ngt_save_index(n.index, C.CString(n.prop.IndexPath), ebuf)
n.mu.Unlock()
n.mu.RUnlock()

if ret == ErrorCode {
err := newGoError(ebuf)
Expand Down

0 comments on commit 2f725a1

Please sign in to comment.