From fa53359b795fd55e52f6b6f8c5b49bf6260a4afc Mon Sep 17 00:00:00 2001 From: Disa Mhembere Date: Thu, 17 Aug 2017 10:52:21 -0400 Subject: [PATCH] mac: refix of closed #49 --- exec/knori.cpp | 2 +- libman/kmeans_thread.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/exec/knori.cpp b/exec/knori.cpp index 43bd76b..77d34cd 100644 --- a/exec/knori.cpp +++ b/exec/knori.cpp @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) unsigned* p_clust_asgns = new unsigned [nrow]; size_t* p_clust_asgn_cnt = new size_t [k]; - if (NULL == p_centers) We have no preallocated centers + if (NULL == p_centers) // We have no preallocated centers p_centers = new double [k*ncol]; if (no_prune) { diff --git a/libman/kmeans_thread.cpp b/libman/kmeans_thread.cpp index 81ae662..83db83f 100644 --- a/libman/kmeans_thread.cpp +++ b/libman/kmeans_thread.cpp @@ -99,8 +99,7 @@ void kmeans_thread::wait() { if (rc) perror("pthread_cond_wait"); } - rc = pthread_mutex_unlock(&mutex); - if (rc) perror("pthread_mutex_unlock"); + pthread_mutex_unlock(&mutex); } void kmeans_thread::wake(thread_state_t state) {