- void write(float *vec) {
- if (size - cpos < bufsize_type(cvlen)) flushToTempFile();
- memcpy(buffer + cpos, vec, FLOATSIZE * cvlen);
- cpos += cvlen;
+ void write(float value, float *vec) {
+ pthread_assert(pthread_mutex_lock(&lock), "pthread_mutex_lock", "Error occurred while acquiring the lock!");
+ if (size - cpos < bufsize_type(vlen)) flushToTempFile();
+ in_mem_arr[to] = value;
+ memcpy(buffer + cpos, vec, FLOATSIZE * vlen);
+ cpos += vlen;